Skip to content

Commit

Permalink
feat: env var mm.profile=dev makes log print on console
Browse files Browse the repository at this point in the history
  • Loading branch information
Scoppio committed Dec 14, 2024
1 parent b049c9a commit b42e4df
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions megamek/mmconf/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</Properties>

<Appenders>
<Console name="Console" target="SYSTEM_OUT" follow="true">
<Console name="dev">
<PatternLayout pattern="${layout}" />
</Console>
<File name="MegaMekLog" fileName="logs/megamek.log" append="false">
Expand All @@ -17,28 +17,30 @@
<File name="MekHQLog" fileName="logs/mekhq.log" append="false">
<PatternLayout pattern="${layout}" />
</File>
<Null name="null" />
</Appenders>

<Loggers>
<Logger name="megamek.client.bot" level="error" additivity="false">
<AppenderRef ref="MegaMekLog" />
<AppenderRef ref="Console" />
<AppenderRef ref="${env:mm.profile:-null}" />
</Logger>
<Logger name="megamek" level="info" additivity="false">
<AppenderRef ref="MegaMekLog" />
<AppenderRef ref="Console" />
<AppenderRef ref="${env:mm.profile:-null}" />
</Logger>
<Logger name="megameklab" level="info" additivity="false">
<AppenderRef ref="MegaMekLabLog" />
<AppenderRef ref="Console" />
<AppenderRef ref="${env:mm.profile:-null}" />
</Logger>
<Logger name="mekhq" level="info" additivity="false">
<AppenderRef ref="MekHQLog" />
<AppenderRef ref="Console" />
<AppenderRef ref="${env:mm.profile:-null}" />
</Logger>

<Root level="info">
<AppenderRef ref="Console" />
<AppenderRef ref="MegaMekLog" />
<AppenderRef ref="${env:mm.profile:-null}" />
</Root>
</Loggers>
</Configuration>

0 comments on commit b42e4df

Please sign in to comment.