Skip to content

Commit

Permalink
♻️ change loki logback pattern to JsonLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
geoje committed Sep 2, 2024
1 parent 27b3b40 commit fe749a8
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions backend/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<springProfile name="dev">
<property name="LOKI_URL" value="http://loki:3100/loki/api/v1/push"/>
</springProfile>
ww
<springProfile name="prod">
<property name="LOKI_URL" value="http://10.0.100.118/loki/api/v1/push"/>
</springProfile>
Expand All @@ -24,16 +25,7 @@
<pattern>app=Pengcook,host=${HOSTNAME},level=%level</pattern>
<readMarkers>true</readMarkers>
</label>
<message>
<pattern>
{
"level":"%level",
"class":"%logger{36}",
"thread":"%thread",
"message": "%replace(%replace(%message){"\\","\\\\"}){"\"","\\\""}"
}
</pattern>
</message>
<message class="com.github.loki4j.logback.JsonLayout"/>
</format>
</appender>

Expand All @@ -44,9 +36,7 @@
</appender>

<root level="INFO">
<springProfile name="!test">
<appender-ref ref="LOKI"/>
</springProfile>
<appender-ref ref="LOKI"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>

0 comments on commit fe749a8

Please sign in to comment.