Created
October 28, 2011 03:21
-
-
Save regtan/1321552 to your computer and use it in GitHub Desktop.
log4jの設定ファイルサンプル デイリーローテート&サイズローテート
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | |
<appender name="FILE" | |
class="org.apache.log4j.CompositeRollingFileAppender"> | |
<param name="File" value="log/sample.log" /> | |
<!-- MaxFileSizeを外すとデイリーローテートのみ --> | |
<param name="MaxFileSize" value="10MB" /> | |
<!-- 世代数 --> | |
<param name="MaxBackupIndex" value="10" /> | |
<param name="datePattern" value="'.'yyyy-MM-dd" /> | |
<layout class="org.apache.log4j.PatternLayout"> | |
<param name="ConversionPattern" value="%d %t %-5p %c{2} - %m%n"/> | |
</layout> | |
</appender> | |
<logger name="jp.co.okisoft.esc.log4j"> | |
<level value="debug" /> | |
<appender-ref ref="FILE" /> | |
</logger> | |
</log4j:configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment