Skip to content

Commit

Permalink
log: Relates #6
Browse files Browse the repository at this point in the history
  • Loading branch information
TabzKid committed Jun 16, 2019
1 parent 5afacda commit fde3072
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,34 @@
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout
pattern="%highlight{%d{HH:mm:ss} [%t] %-5level %c{6} - %msg%n}{INFO=black, WARN=yellow, FATAL=red}" disableAnsi="false"/>
pattern="%highlight{%d{HH:mm:ss} [%t] %-5level %c{6} - %msg%n}{INFO=black, WARN=yellow, FATAL=red}"
disableAnsi="false"/>
<Filters>
<ThresholdFilter level="warn" onMatch="DENY" onMisMatch="NEUTRAL"/>
</Filters>
</Console>
<File name="file" fileName="logs/app.log">

<File name="warnFile" fileName="logs/warning.log">
<PatternLayout>
<pattern>%d{HH:mm:ss} [%t] %-5level %c{6} - %msg%n</pattern>
</PatternLayout>
<Filters>
<ThresholdFilter level="fatal" onMatch="DENY" onMisMatch="NEUTRAL"/>
</Filters>
</File>

<File name="fatalFile" fileName="logs/fatal.log">
<PatternLayout>
<pattern>%d{HH:mm:ss} [%t] %-5level %c{6} - %msg%n</pattern>
</PatternLayout>
</File>

</Appenders>
<Loggers>
<Root level="debug" additivity="false">
<AppenderRef ref="console"/>
<appender-ref ref="file"/>
<AppenderRef ref="console" level="debug"/>
<AppenderRef ref="warnFile" level="warn"/>
<AppenderRef ref="fatalFile" level="fatal"/>
</Root>
</Loggers>
</configuration>

0 comments on commit fde3072

Please sign in to comment.