log4j.properties
log4j.rootLogger=info, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %c - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File= ../tp/logs/MichelleServer_debug.log
log4j.appender.R.DatePattern='.'yyyy-MM-dd
log4j.appender.R.Append = true
log4j.appender.R.Threshold = DEBUG
log4j.appender.R.MaxFileSize=2048KB
log4j.appender.R.MaxBackupIndex=100
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %p %c - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File= ../tp/logs/MichelleServer_error.log
log4j.appender.R.DatePattern='.'yyyy-MM-dd
log4j.appender.R.Append = true
log4j.appender.R.Threshold = ERROR
log4j.appender.R.MaxFileSize=2048KB
log4j.appender.R.MaxBackupIndex=100
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %p %c - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File= ../tp/logs/MichelleServer_info.log
log4j.appender.R.DatePattern='.'yyyy-MM-dd
log4j.appender.R.Append = true
log4j.appender.R.Threshold = INFO
log4j.appender.R.MaxFileSize=2048KB
log4j.appender.R.MaxBackupIndex=100
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %p %c - %m%n
log4j.logger.org.hibernate=INFO
#log4j.logger.org.hibernate=DEBUG
log4j.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="rollingFile" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="../server/default/tp/logs/MichelleV7.log"/>
<param name="MaxFileSize" value="2048KB"/>
<param name="MaxBackupIndex" value="100"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %C - %m%n"/>
</layout>
</appender>
<appender name="ST_DEBUG" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="../tp/logs/MichelleV7_debug.log" />
<param name="DatePattern" value="'-'yyyy-MM-dd'.log'" />
<param name="Append" value="true" />
<param name="Threshold" value="DEBUG"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yy-MM-dd HH:mm:ss,SSS} %-5p %c - %m%n"/>
</layout>
</appender>
<appender name="ST_INFO" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="../tp/logs/MichelleV7_info.log" />
<param name="DatePattern" value="'-'yyyy-MM-dd'.log'" />
<param name="Append" value="true" />
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yy-MM-dd HH:mm:ss,SSS} %-5p %c - %m%n"/>
</layout>
</appender>
<appender name="ST_ERROR" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="../tp/logs/MichelleV7_error.log" />
<param name="DatePattern" value="'-'yyyy-MM-dd'.log'" />
<param name="Append" value="true" />
<param name="Threshold" value="ERROR"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yy-MM-dd HH:mm:ss,SSS} %-5p %c - %m%n"/>
</layout>
</appender>
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %C - %m%n"/>
</layout>
</appender>
<appender name="asyncAppender" class="org.apache.log4j.AsyncAppender">
<param name="BufferSize" value="512"/>
<appender-ref ref="rollingFile"/>
</appender>
<logger name="org.hibernate">
<level value="ERROR"/>
</logger>
<logger name="org.hibernate.SQL">
<level value="ERROR"/>
</logger>
<logger name="com.opensymphony">
<level value="ERROR"/>
</logger>
<logger name="com.opensymphony.xwork2.interceptor">
<level value="ERROR"/>
</logger>
<logger name="com.opensymphony.xwork2.util">
<level value="ERROR"/>
</logger>
<logger name="com.freemarker.log">
<level value="ERROR"/>
</logger>
<logger name="org.apache.struts2.components">
<level value="ERROR"/>
</logger>
<logger name="com.opensymphony.xwork2.ognl.OgnlValueStack">
<level value="ERROR"/>
</logger>
<logger name="org.apache.struts2.util.TextProviderHelper">
<level value="ERROR"/>
</logger>
<root>
<level value="INFO"/>
<appender-ref ref="rollingFile"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="ST_DEBUG" />
<appender-ref ref="ST_INFO" />
<appender-ref ref="ST_ERROR" />
</root>
</log4j:configuration>