Sending the only com.dashboard.process [debug] information to a file.... AND
Sending the info messages of com.dashboard [info] information to another file including the info
messages of com.dashboard.process.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration PUBLIC "-//LOGGER" "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd"> <log4j:configuration> <!-- an appender is an output destination, such as the console or a file; names of appenders are arbitrarily chosen --> <appender name="stdout" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.EnhancedPatternLayout"> <param name="ConversionPattern" value="%d %-5p %c{1} (%F:%L) %m%n" /> </layout> </appender> <appender name="stderr" class="org.apache.log4j.ConsoleAppender"> <param name="target" value="System.err" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %d [%t][%F:%L] : %m%n" /> </layout> </appender> <appender name="file" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="${log4j.dir}/dashboard.log" /> <param name="MaxFileSize" value="2Mb" /> <param name="MaxBackupIndex" value="5" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %d [%t][%F:%L] : %m%n" /> </layout> </appender> <appender name="harvestor" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="${log4j.dir}/dashboard-harvest.log" /> <param name="MaxFileSize" value="2Mb" /> <param name="MaxBackupIndex" value="5" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-5p %d [%t][%F:%L] : %m%n" /> </layout> </appender> <category name="org.springframework.ui.velocity"> <priority value="WARN" /> </category> <category name="org.springframework.web.servlet.view.velocity"> <priority value="WARN" /> </category> <category name="org.apache.velocity.runtime"> <priority value="WARN" /> </category> <category name="org.springframework.web.util" additivity="false"> <priority value="WARN" /> </category> <category name="org.eclipse.jetty.servlet"> <priority value="WARN" /> </category> <category name="com.dashboard.process" additivity="false"> <priority value="DEBUG"></priority> </category> <category name="com.dashboard" additivity="true"> <priority value="INFO"></priority> </category> <!-- the root category --> <!-- all log messages of level "debug" or higher will be logged, unless defined otherwise all log messages will be logged to the appender "stdout", unless defined otherwise --> <logger name="com.dashboard"> <level value="INFO" /> <appender-ref ref="file" /> </logger> <logger name="com.dashboard.process" additivity="false"> <level value="DEBUG" /> <appender-ref ref="harvestor" /> </logger> </log4j:configuration>