-
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.
Add loki4j logback appenders for local, prod, and stdout (#109)
- Loading branch information
Daniel Villavicencio
authored
Jun 25, 2024
1 parent
a7d8a74
commit 9a79591
Showing
3 changed files
with
55 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,4 @@ spring: | |
|
||
application: | ||
callback: | ||
url: https://rivenbot.app | ||
|
||
logging: | ||
level: | ||
root: DEBUG | ||
url: https://rivenbot.app |
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 |
---|---|---|
@@ -1,44 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<!-- Local configuration --> | ||
<SpringProfile name="local"> | ||
<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> | ||
<appender name="LOKI_LOCAL" class="com.github.loki4j.logback.Loki4jAppender"> | ||
<http> | ||
<url>http://localhost:3100/loki/api/v1/push</url> | ||
<connectionTimeoutMs>60000</connectionTimeoutMs> | ||
<requestTimeoutMs>10000</requestTimeoutMs> | ||
</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> | ||
|
||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<!-- Production configuration --> | ||
<appender name="LOKI_PROD" class="com.github.loki4j.logback.Loki4jAppender"> | ||
<http> | ||
<url>http://loki:3100/loki/api/v1/push</url> | ||
<connectionTimeoutMs>60000</connectionTimeoutMs> | ||
<requestTimeoutMs>10000</requestTimeoutMs> | ||
</http> | ||
<format> | ||
<label> | ||
<pattern>level=%level</pattern> | ||
<readMarkers>true</readMarkers> | ||
</label> | ||
<message> | ||
<pattern>%-5level [%.5(${HOSTNAME})] %.10thread %logger{20} | %msg %ex</pattern> | ||
</message> | ||
</format> | ||
<verbose>true</verbose> | ||
<metricsEnabled>true</metricsEnabled> | ||
</appender> | ||
|
||
<SpringProfile name="prod"> | ||
<root level="INFO"> | ||
<appender-ref ref="LOKI"/> | ||
<appender-ref ref="LOKI_PROD"/> | ||
<appender-ref ref="STDOUT"/> | ||
</root> | ||
</SpringProfile> | ||
|
||
<!-- Production configuration --> | ||
<SpringProfile name="prod"> | ||
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender"> | ||
<http> | ||
<url>http://rivenbot.app: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> | ||
<SpringProfile name="local"> | ||
<root level="INFO"> | ||
<appender-ref ref="LOKI"/> | ||
<appender-ref ref="LOKI_LOCAL"/> | ||
<appender-ref ref="STDOUT"/> | ||
</root> | ||
</SpringProfile> | ||
</configuration> |