Skip to content

Commit

Permalink
feat: add file log
Browse files Browse the repository at this point in the history
  • Loading branch information
BulatRuslanovich committed Oct 14, 2024
1 parent a08df88 commit 2abb2e6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dispatcher/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
pattern="%highlight{%-5p} %d{yyyy-MM-dd HH:mm:ss} %style{%marker} %c{1} -- %highlight{%m}%ex{short}%n"
/>
</Console>

<RollingFile name="FILE" fileName="logs/dispatcher.log"
filePattern="logs/dispatcher-%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout
pattern="%-5p %d{yyyy-MM-dd HH:mm:ss} %c{3} -- %m%ex%n"
/>
<Policies>
<SizeBasedTriggeringPolicy size="20MB"/>
</Policies>
<DefaultRolloverStrategy max="5"/>
</RollingFile>
</Appenders>

<Loggers>
Expand All @@ -31,6 +42,7 @@

<Root level="INFO">
<AppenderRef ref="CONSOLE"/>
<AppenderRef ref="FILE"/>
</Root>
</Loggers>
</Configuration>
12 changes: 12 additions & 0 deletions node/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
pattern="%highlight{%-5p} %d{yyyy-MM-dd HH:mm:ss} %style{%marker} %c{1} -- %highlight{%m}%ex{short}%n"
/>
</Console>

<RollingFile name="FILE" fileName="logs/node.log"
filePattern="logs/node-%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout
pattern="%-5p %d{yyyy-MM-dd HH:mm:ss} %c{3} -- %m%ex%n"
/>
<Policies>
<SizeBasedTriggeringPolicy size="20MB"/>
</Policies>
<DefaultRolloverStrategy max="5"/>
</RollingFile>
</Appenders>

<Loggers>
Expand All @@ -31,6 +42,7 @@

<Root level="INFO">
<AppenderRef ref="CONSOLE"/>
<AppenderRef ref="FILE"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit 2abb2e6

Please sign in to comment.