Server Log
As Union Server runs, it generates an operational log which, by default, is written to a file named log.txt in the server's root installation directory. The log contains information about the server environment, the rooms and clients on the server, and messages being sent to and received from clients. Union Server's log can be viewed in a text editor or through Union Admin's Log tab.
Setting Union Server's Log Verbosity
Log verbosity controls the amount of information written to the log. Lower verbosity reduces the file size of log.txt and increases server performance.
To permanently change Union Server's log verbosity, follow these steps:
- In the /lib/ folder of Union Server's installation root directory, edit the file named log4j.properties.
- On the first line of log4j.properties, set log4j.rootLogger's first parameter to the desired log level. Available log levels are: "debug" (most verbose), "info", "warn", "error", and "fatal" (least verbose). For example, the following line sets the log level to "fatal":
log4j.rootLogger=fatal, union, admin, client
To change the verbosity of Union Server's log at runtime, use the Log level menu on Union Admin's Log tab. Note, however, that changes made to the log level via Union Admin are not permanent. When Union Server restarts, its log level reverts to the level specified in log4j.properties.
Renaming log.txt
To change the location or name of log.txt, follow these steps:
- In the /lib/ folder of Union Server's installation root directory, edit the file named log4j.properties.
- In the following line, change the value of log4j.appender.union.File to the desired file system path and file name. For example, the following code changes log.txt's name to unionlog.txt:
log4j.appender.union.File=unionlog.txt
Log Example
Here is an example showing the contents of log.txt after starting Union Server on log level "warn":
2011-02-28 22:07:38,239 WARN - ****************************************************** 2011-02-28 22:07:38,239 WARN - *** Starting Union Server Beta 1 1.0.0 (build 455) *** 2011-02-28 22:07:38,239 WARN - ****************************************************** 2011-02-28 22:07:38,239 WARN - UPC Version: 1.8.1 2011-02-28 22:07:38,240 WARN - Java VM: 1.6.0_22 from Apple Inc. 2011-02-28 22:07:38,325 WARN - Using CharSet [UTF-8] 2011-02-28 22:07:38,358 WARN - UNION_HOME set to [/Users/USER1/Desktop/dttemp/download/union/.] 2011-02-28 22:07:40,565 WARN - Datasource [union] added to server. 2011-02-28 22:07:40,568 WARN - Banned list file [banned.txt] not found. Banned list not initiated. 2011-02-28 22:07:40,569 WARN - Server module [serverStatsServerModule] loaded. 2011-02-28 22:07:40,578 WARN - Gateway [IOGateway] bound to port [9100] on all local IP addresses. 2011-02-28 22:07:40,643 WARN - Gateway [NIOGateway] bound to port [9101] on all local IP addresses. 2011-02-28 22:07:40,643 WARN - POLICY_FILE attribute missing for Gateway [_ADMIN_GATEWAY_]. Using default [policy.xml]. 2011-02-28 22:07:40,644 WARN - Gateway [_ADMIN_GATEWAY_] bound to port [9110] on all local IP addresses. 2011-02-28 22:07:40,644 WARN - Admin Gateway Started. 2011-02-28 22:07:40,798 WARN - Union Server Beta 1 1.0.0 (build 455) Started....OK