-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental logback-spring setup for Loki and Grafana
- Loading branch information
Daniel Villavicencio
authored and
Daniel Villavicencio
committed
May 19, 2024
1 parent
8cd0393
commit 34830c4
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<!-- local configuration --> | ||
<springProfile name="local"> | ||
<configuration> | ||
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender"> | ||
<http> | ||
<url>http://localhost:3100/loki/api/v1/push</url> | ||
</http> | ||
<format> | ||
<label> | ||
<pattern>level=%level</pattern> | ||
<readMarkers>true</readMarkers> | ||
</label> | ||
<message> | ||
<pattern>%-5level [%.5(${HOSTNAME})] %.10thread %logger{20} | %msg %ex</pattern> | ||
</message> | ||
</format> | ||
</appender> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="LOKI"/> | ||
</root> | ||
</configuration> | ||
<!-- prod configuration --> | ||
</springProfile> | ||
<springProfile name="prod"> | ||
<configuration> | ||
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender"> | ||
<http> | ||
<url>http://loki:3100/loki/api/v1/push</url> | ||
</http> | ||
<format> | ||
<label> | ||
<pattern>level=%level</pattern> | ||
<readMarkers>true</readMarkers> | ||
</label> | ||
<message> | ||
<pattern>%-5level [%.5(${HOSTNAME})] %.10thread %logger{20} | %msg %ex</pattern> | ||
</message> | ||
</format> | ||
</appender> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="LOKI"/> | ||
</root> | ||
</configuration> | ||
</springProfile> | ||
</configuration> |