Logging is enabled when the logFile option is set in the properties file, and the value is a file which the Chat Relay can create and write to. If the value of logFile does not include the full path to the file, then the Chat Relay's working directory will be used. If this option is missing or empty, or if the specified file is not writable, then no logging will occur. The default value in the properties file is checkvalvechatrelay.log without any path specified.
If log rotation is enabled, then the log file will be rotated at the interval specified by the logRotateInterval option in the properties file. Old logs are stored in the same directory as the open log file, and the number of old logs which are kept when a rotation occurs is specified by the logRotateKeepFiles option in the properties file. In the default properties file, log rotation is enabled and will occur once per week, and up to 10 old log files will be kept.
On startup, the Chat Relay will write a series of log messages prefixed with [STARTUP] which give some basic information about the environment and configuration.
On shutdown, the Chat Relay will write a series of log messages prefixed with [SHUTDOWN] which include information about the shutdown process.
For each successful connection attempt, the Chat Relay will log the client's IP address and port number, the IP address and port number of the game server from which the client wants to receive chat messages, and the internal connection slot to which the client has been assigned (the number of available connection slots is specified by the maxClients option in the properties file). The Chat Relay will also log client errors or disconnections.
For each rejected connection attempt, the Chat Relay will log the client's IP address and port number, and the reason the connection was rejected. A rejected connection will not be logged if auto-banning is enabled and the client IP has been banned.
If an error occurs, the Chat Relay will attempt to log the error and resume normal operations, if possible. Error messages are prefixed with ERROR: and usually include a description of the error, as well as an indication regarding whether or not the error was fatal. To see more detailed information about errors and exceptions, increase the value of the debugLevel option in the properties file (see Configuring the Chat Relay).
If auto-banning is enabled, then the Chat Relay will write log messages whenever new bans are put in place or old bans expire. Each of these messages is prefixed with [AUTO-BAN].
If statistics logging is enabled, then the Chat Relay will periodically write some statistics to the log file. Each of these messages is prefixed with [STATS]. The interval at which these statistics are logged is defined by the logStatsInterval option in the properties file. In the default properties file, statistics logging is enabled and will occur once every 24 hours.
These messages include the following information about the Chat Relay:
Uptime (how long the Chat Relay has been running)
Memory usage
Maximum memory which the Chat Relay can use (defined in the startup script)
Amount of memory which has been allocated to the Chat Relay
Amount of the allocated memory which is currently being used
Amount of the allocated memory which is currently free
Total number of packets received since startup
Number of chat packets processed since startup
Number of accepted client connections since startup
Number of rejected client connections since startup
Number of clients currently connected
Number of clients currently banned (if auto-banning is enabled)
Notes:
A packet is only processed if there is at least one client who wants messages from the game server which sent the packet. Therefore, the number of chat packets processed only reflects those packets which were received when a client was listening for those chat messages.
The memory usage numbers are not averaged over time; these are simply the real-time values polled at the time the statistics are logged. However, these values can be useful in spotting memory leaks, or determining whether the runtime memory settings need to be adjusted.
If debug logging is enabled, then the Chat Relay will write more verbose messages to the log file. Each debug message is prefixed with [DEBUG(#)] where # is the debug level which caused the message to be written. Debug logging is enabled by setting a non-zero value for the debugLevel option in the properties file. Log messages are written for all debug levels up to and including the specified level.
If update checking is enabled, then the CheckValve Chat Relay will check for a newer version on startup, and then re-check at the interval specified by updateCheckInterval (once per day by default). If an update is available, then a message will be logged. The message will also be shown on the console if (and only if) an update is detected during startup. Each of these messages is prefixed with [UPDATE].
Prev: Securing the Chat Relay