dotCMS - Open Source Content Management System, Ondemand CMS, and Professional Support

Document Search

Article Information

Since Version: 1.6.5
Tags: Logging Configuration Logging Maintenance
Updated: 12/6/2008 12:20:19 PM
By: Jason Tesser
Doc id: 144956
Print Page: Export to PDF

Logging Configuration

With dotCMS 1.6.5 the logging system was overhauled.  Not only is it more performant but allows easier configuration of log rotating and setting up of multiple loggers. For example having one logger that logs to the console and one logger that logs to a file. For those familiar with log4J you will be very comfortable as that is what dotCMS uses to log.

To config dotCMS logging open the file common/ext-ejb/log4j.xml.  By default the file has 2 appenders configured.  These appenders log the dotCMS messages to places. For example the CONSOLE appender logs to the console and the FILE appender logs to a file.  By default the file appender logs to logs/dotcms.log.  Based upon the configuration of the ConversionPattern the file will rotate.

By default dotCMS only uses the FILE appender. If you also want to log to the console you must configure primary the following. By default it looks like this

<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
    <appender-ref ref="FILE"/>
</appender>

To add the CONSOLE appender you would configure it as so

<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
    <appender-ref ref="FILE"/>
    <appender-ref ref="CONSOLE"/>
</appender>

You can also filter logging on specific classes if needed. For example to configure logging on just webdav classes you would use the following

<logger name="com.dotmarketing.webdav">
     <level value="info"/>
</logger>

By changing level value you can make it log default.  Anything not specifically configured will log according to the ROOT logger priority value.

<root>
     <priority value="info"/>
     <appender-ref ref="ASYNC"/>
</root>


Post a Comment


Add Comments

   

 
Post