The log4j.xml file

XMS Server uses Apache log4j for its logging facilites. This allows for a great deal of flexibility and configuration for server administrators.

Setting the log level

There are 5 log levels that you can set:

  • FATAL — logs only fatal errors

  • ERROR — logs all errors

  • WARN — logs warnings, and all errors

  • INFO — logs information, warnings, and all errors

  • DEBUG — logs debug information, and all other levels

To set XMS's log level to INFO set the value attribute of the level tag inside the root tag:

<root>
  <appender-ref ref="default"/>				  
  <level value="INFO"/>	  
</root>
			

Log4j appenders

One of the nice features of log4j is that it allows you to configure different appenders. Appenders are sources that the logs are sent to, you can setup log4j to append to the console, files, remote sockets, Windows NT Event log, UNIX Syslog, JMS and more.

To setup XMS to output to the console as well as to a log file try something like this:

...
												 
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
  <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value="%-4r %-5p %c %x - %m%n"/>
  </layout>
</appender>
<root>
	<appender-ref ref="stdout" />
    <appender-ref ref="default"/>
    <level value="debug"/>
</root>
...