Skip to content

Commit

Permalink
Change the log type to be rolling file
Browse files Browse the repository at this point in the history
  • Loading branch information
xinzhelKinesis committed Oct 14, 2020
1 parent 7c99db5 commit 38ef389
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions support/log4j.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Appenders>
<File name="FILE" fileName="/var/log/aws-kinesis-agent/aws-kinesis-agent.log" append="true">
<RollingFile name="FILE" fileName="/var/log/aws-kinesis-agent/aws-kinesis-agent.log" filePattern="/var/log/aws-kinesis-agent/aws-kinesis-agent-%d{yyyy-MM-dd-HH}.log.gz">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSSZ} %X{hostname} (%t) %c [%p] %m%n" />
</File>
<File name="FALLBACK" fileName="/tmp/fallback-aws-kinesis-agent.log" append="true">
<Policies>
<TimeBasedTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="/var/log/aws-kinesis-agent" maxDepth="1">
<IfFileName glob="aws-kinesis-agent*log*" />
<IfLastModified age="7d" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
<RollingFile name="FALLBACK" fileName="/tmp/fallback-aws-kinesis-agent.log" filePattern="/tmp/fallback-aws-kinesis-agent-%d{yyyy-MM-dd-HH}.log.gz">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSSZ} %X{hostname} (%t) %c [%p] %m%n" />
</File>
<Policies>
<TimeBasedTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="/tmp" maxDepth="1">
<IfFileName glob="fallback-aws-kinesis-agent*log*" />
<IfLastModified age="7d" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="LOG: %d{yyyy-MM-dd HH:mm:ss.SSSZ} %X{hostname} (%t) %c [%p] %m%n" />
</Console>
Expand Down

0 comments on commit 38ef389

Please sign in to comment.