Skip to content

Instantly share code, notes, and snippets.

@zzzfree
Created September 23, 2013 14:04
Show Gist options
  • Save zzzfree/6670859 to your computer and use it in GitHub Desktop.
Save zzzfree/6670859 to your computer and use it in GitHub Desktop.
log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration status="OFF">
<appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
<RollingFile name="RollingFile" fileName="logs/app.log"
filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
<PatternLayout>
<pattern>%d %p %C{1.} [%t] %m%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="250 MB" />
</Policies>
</RollingFile>
</appenders>
<loggers>
<root level="all">
<appender-ref ref="Console" />
<appender-ref ref="RollingFile" />
</root>
</loggers>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment