Skip to content

Commit

Permalink
feat: Support json logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfaircloth authored and gaul committed Jan 21, 2025
1 parent b8bd258 commit 7239ed4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/Logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Logging

## Configuration

The following environment variables can be used to configure logging

* LOG_LEVEL default value "info" used to configure log level
* LOG_APPENDER default value "STDOUT" produce string formatted logs "CONTAINER" used to produce json formatted logs
8 changes: 7 additions & 1 deletion src/main/config/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
<level>${LOG_LEVEL:-info}</level>
</filter>
</appender>
<appender name="CONTAINER" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.JsonEncoder"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${LOG_LEVEL:-info}</level>
</filter>
</appender>

<logger name="org.eclipse.jetty" level="${JETTY_LOG_LEVEL:-info}" />
<logger name="org.gaul.shaded.org.eclipse.jetty" level="${JETTY_LOG_LEVEL:-info}" />

<root level="${LOG_LEVEL:-info}">
<appender-ref ref="STDOUT" />
<appender-ref ref="${LOG_APPENDER:-STDOUT}" />
</root>
</configuration>

0 comments on commit 7239ed4

Please sign in to comment.