-
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.
* fix : loki 오류 fix * refactor : Loki appender 파일 분리
- Loading branch information
1 parent
5faa9e8
commit 716e787
Showing
2 changed files
with
18 additions
and
17 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 |
---|---|---|
@@ -1,39 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration scan="true" scanPeriod="5 seconds"> | ||
<include resource="appenders/console-appender.xml"/> | ||
<property name="loki.url" value="${LOKI_URL:-localhost}" /> | ||
<springProfile name="local"> | ||
<root level="INFO"> | ||
<appender-ref ref="CONSOLE_APPENDER"/> | ||
<appender-ref ref="LOKI_APPENDER"/> | ||
</root> | ||
</springProfile> | ||
|
||
<springProfile name="dev"> | ||
<root level="INFO"> | ||
<appender-ref ref="CONSOLE_APPENDER"/> | ||
<appender-ref ref="LOKI_APPENDER"/> | ||
</root> | ||
</springProfile> | ||
|
||
<springProfile name="prod"> | ||
<root level="ERROR"> | ||
<appender-ref ref="CONSOLE_APPENDER"/> | ||
<appender-ref ref="SENTRY_APPENDER"/> | ||
|
||
<appender name="LOKI_APPENDER" class="com.github.loki4j.logback.Loki4jAppender"> | ||
<http> | ||
<url>http://${loki.url}:3100/loki/api/v1/push</url> | ||
</http> | ||
<format> | ||
<label> | ||
<pattern>app=${name},host=${HOSTNAME},level=%level</pattern> | ||
<readMarkers>true</readMarkers> | ||
</label> | ||
<message> | ||
<pattern>%highlight([%-5level]) %d{yy-MM-dd HH:mm:ss.SSS} %green([%thread]) %yellow([traceId=%X{traceId}]) %cyan([%logger{0}:%line])-%message%n</pattern> | ||
</message> | ||
<sortByTime>true</sortByTime> | ||
</format> | ||
</appender> | ||
<appender-ref ref="LOKI_APPENDER"/> | ||
</root> | ||
</springProfile> | ||
</configuration> |