JBoss.orgCommunity Documentation

Chapter 21. Logs configuration

21.1. Introdution
21.2. Logs configuration initializer
21.3. Configuration examples
21.3.1. Log4J
21.3.2. JDK Logging
21.3.3. Commons Logging SimpleLog
21.4. Tips and Troubleshooting
21.4.1. JBoss tips
21.4.2. Other tips

In order to accommodate to the different target runtime where it can be deployed, eXo is capable of leveraging several logging systems. eXo let's you choose the underlying logging engine to use and even configure that engine (as a quick alternative to doing it directly in your runtime environment).

The currently supported logging engines are :

eXo lets you choose whatever logging engine you want as this is generally influences by the AS runtime or internal policy.

This is done through an eXo component called LogConfigurationInitializer.

org.exoplatform.services.log.LogConfigurationInitializer that reads init parameters and configures logging system according to them. The parameters:

Log4J is a very popular and flexible logging system. It is a good option for JBoss.

  <component>
    <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
    <init-params>
      <value-param>
        <name>logger</name>
        <value>org.exoplatform.services.log.impl.BufferedLog4JLogger</value>
      </value-param>
      <value-param>
        <name>configurator</name>
        <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
      </value-param>
      <properties-param>
        <name>properties</name>
        <description>Log4J properties</description>
        <property name="log4j.rootLogger" value="DEBUG, stdout, file"/>
        <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender"/>
        <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout"/>
        <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d {dd.MM.yyyy HH:mm:ss} %c {1}: %m (%F, line %L) %n"/>
        <property name="log4j.appender.file" value="org.apache.log4j.FileAppender"/>
        <property name="log4j.appender.file.File" value="jcr.log"/>
        <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout"/>
        <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} %m (%F, line %L) %n"/>
      </properties-param >
    </init-params>
  </component>