indexing description: "socket server example sending ELOG_STORABLE_EVENTs" library: "elogger" copyright: "Copyright (c) 2006, AXA Rosenberg, and others (see copyright.txt)" author: "Ulrich Weiss, and others" license: "Eiffel Forum License v2 (see forum.txt)" date: "$Date: $" revision: "$Revision: $" archive: "$Archive: $" class ELOG_TEST_SOCKET_SERVER inherit KL_SHARED_ARGUMENTS export {NONE} all end NETWORK_SERVER rename make as server_make export {NONE} server_make redefine received end ELOG_SHARED_INTERNAL_LOGGER creation make feature -- Initialization make (a_port: INTEGER) is -- Create and initialise a new client that will write log events -- to a socket appender. require a_port_valid: a_port > 0 and a_port <= 65535 do io.put_string ("Starting Server, listening to port "+a_port.out+"%N") server_make (a_port) execute rescue internal_logger.log_warning (create {ELOG_SIMPLE_EVENT}.make ("Could not start server on port "+a_port.out)) cleanup end feature {NONE} -- Implementation received: ELOG_STORABLE_EVENT -- simple Logging event with no reference to the logger. process_message is -- Process 'received' do print ("Event:%N") print ("%TMessage: " + received.message + "%N") print ("%TLogger: " + received.logger_name + "%N") print ("%TTimestamp: " + received.time_stamp + "%N") print ("%TSeverity: " + received.severity + "%N") print ("%TFormatted: " + received.formatted_message + "%N") print ("%N") end end