mirror of
https://github.com/tiennm99/store-scraper-bot.git
synced 2026-10-14 06:17:58 +00:00
feat(loki): send logs to loki to centralize logs
This commit is contained in:
1 parent
ec9ad27f09
commit
0f5fdca3e7
3 files changed
+23
No files matched your search
@@ -3,6 +3,8 @@
|
||||
<Properties>
|
||||
<Property name="CONSOLE_LOG_PATTERN">%d{HH:mm:ss.SSS} %5p --- [%t] %c : %m%n</Property>
|
||||
<Property name="CONSOLE_LOG_CHARSET">UTF-8</Property>
|
||||
<Property name="LOKI_LOG_PATTERN">%d{yyyy-MM-dd HH:mm:ss.SSS} %5p --- [%t] %c : %m%n</Property>
|
||||
<Property name="LOKI_LOG_CHARSET">UTF-8</Property>
|
||||
</Properties>
|
||||
|
||||
<Appenders>
|
||||
@@ -12,10 +14,24 @@
|
||||
<ThresholdFilter level="TRACE"/>
|
||||
</Filters>
|
||||
</Console>
|
||||
|
||||
<Loki name="Loki">
|
||||
<host>${env:LOKI_HOST}</host>
|
||||
<port>${env:LOKI_PORT}</port>
|
||||
|
||||
<username>${env:LOKI_USERNAME}</username>
|
||||
<password>${env:LOKI_PASSWORD}</password>
|
||||
|
||||
<PatternLayout pattern="${LOKI_LOG_PATTERN}" charset="${LOKI_LOG_CHARSET}"/>
|
||||
|
||||
<Label name="service_name" value="StoreScraperBot"/>
|
||||
<Label name="environment" value="${env:ENV}"/>
|
||||
</Loki>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="${env:LOG_LEVEL:-debug}">
|
||||
<AppenderRef ref="ConsoleAppender"/>
|
||||
<AppenderRef ref="Loki"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
Reference in new issue
Block a user