Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 33 additions & 31 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,43 @@
</appender>

<!-- Loki Appender -->
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
<springProfile name="!test">
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">

<http>
<url>${LOKI_URL}</url>
<connectionTimeoutMs>30000</connectionTimeoutMs>
<requestTimeoutMs>15000</requestTimeoutMs>
<maxRetries>3</maxRetries>
<backoffMs>1000</backoffMs>
</http>
<http>
<url>${LOKI_URL}</url>
<connectionTimeoutMs>30000</connectionTimeoutMs>
<requestTimeoutMs>15000</requestTimeoutMs>
<maxRetries>3</maxRetries>
<backoffMs>1000</backoffMs>
</http>

<batchSize>100</batchSize>
<batchTimeoutMs>10000</batchTimeoutMs>
<bufferSize>1048576</bufferSize>
<batchSize>100</batchSize>
<batchTimeoutMs>10000</batchTimeoutMs>
<bufferSize>1048576</bufferSize>

<format>
<label>
<pattern>app=my-app,host=${HOSTNAME},environment=${ENV:-local},service=${SERVICE_NAME:-somemore}</pattern>
</label>
<message class="com.github.loki4j.logback.JsonLayout">
<includeTimestamp>true</includeTimestamp>
<includeMDC>true</includeMDC>
<includeThreadName>true</includeThreadName>
<includeLoggerName>true</includeLoggerName>
<jsonFactory>JACKSON</jsonFactory>
<timestampFieldName>@timestamp</timestampFieldName>
<prettyPrint>false</prettyPrint>
<appendLineSeparator>true</appendLineSeparator>
<messageTemplate>${LOG_PATTERN}</messageTemplate>
<timestampFormat>yyyy-MM-dd HH:mm:ss.SSS</timestampFormat>
</message>
<timestampPattern>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampPattern>
</format>
<format>
<label>
<pattern>app=my-app,host=${HOSTNAME},environment=${ENV:-local},service=${SERVICE_NAME:-somemore}</pattern>
</label>
<message class="com.github.loki4j.logback.JsonLayout">
<includeTimestamp>true</includeTimestamp>
<includeMDC>true</includeMDC>
<includeThreadName>true</includeThreadName>
<includeLoggerName>true</includeLoggerName>
<jsonFactory>JACKSON</jsonFactory>
<timestampFieldName>@timestamp</timestampFieldName>
<prettyPrint>false</prettyPrint>
<appendLineSeparator>true</appendLineSeparator>
<messageTemplate>${LOG_PATTERN}</messageTemplate>
<timestampFormat>yyyy-MM-dd HH:mm:ss.SSS</timestampFormat>
</message>
<timestampPattern>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampPattern>
</format>

<timeZone>Asia/Seoul</timeZone>
</appender>
<timeZone>Asia/Seoul</timeZone>
</appender>
</springProfile>

<logger name="com.somemore.application" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE" />
Expand Down
Loading