Skip to content

Commit

Permalink
Added LOG_TYPE environmental variable (#120)
Browse files Browse the repository at this point in the history
This disables JSON logging by default, but allows the user to enable it by setting LOG_TYPE=JSON
  • Loading branch information
woop authored and feast-ci-bot committed Feb 6, 2019
1 parent 98888cf commit ba33b6b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions core/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,26 @@
-->

<Configuration status="WARN">
<Properties>
<Property name="LOG_PATTERN">
%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${hostName} --- [%15.15t] %-40.40c{1.} : %m%n%ex
</Property>
<Property name="APPENDER_TYPE">${env:LOG_TYPE:-Console}</Property>
</Properties>
<CustomLevels>
<CustomLevel name="AUDIT" intLevel="350" />
</CustomLevels>

<Appenders>
<Console name="JSONConsoleAppender" target="SYSTEM_OUT" follow="true">
<JsonLayout compact="true" eventEol="true" objectMessageAsJsonObject="true" />
<Console name="ConsoleAppender" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="${LOG_PATTERN}"/>
</Console>
<Console name="JSONAppender" target="SYSTEM_OUT" follow="true">
<JsonLayout compact="true" eventEol="true" objectMessageAsJsonObject="true" />
</Console>
</Appenders>

<Loggers>
<Root level="info">
<AppenderRef ref="JSONConsoleAppender" />
<AppenderRef ref="${APPENDER_TYPE}Appender" />
</Root>
</Loggers>
</Configuration>
</Configuration>

0 comments on commit ba33b6b

Please sign in to comment.