Write logs to file, add color to Console logs, ignore logfiles from Git

This commit is contained in:
Max Martens 2024-12-05 15:47:56 +01:00
parent 5c83fff7bf
commit 89b5f0a169
2 changed files with 14 additions and 2 deletions

View File

@ -37,3 +37,5 @@ build/
### Mac OS ###
.DS_Store
/logs

View File

@ -8,10 +8,20 @@
<Console name="STDOUT-NOCOLOR">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5level | %-28c{1} - %msg [%t]%n"/>
</Console>
<RollingFile name="FILE-NOCOLOR"
fileName="logs/rabbitmq-poc.log"
filePattern="logs/rabbitmq-poc.log.%i.gz">
<DefaultRolloverStrategy max="100"/>
<Policies>
<SizeBasedTriggeringPolicy size="1M"/>
</Policies>
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5level | %-28c{1} - %msg [%t]%n"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="STDOUT-NOCOLOR"/>
<AppenderRef ref="STDOUT-COLOR"/>
<AppenderRef ref="FILE-NOCOLOR"/>
</Root>
</Loggers>
</Configuration>