|
28 | 28 | </appender> |
29 | 29 |
|
30 | 30 | <!-- Loki Appender --> |
31 | | - <appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender"> |
| 31 | + <springProfile name="!test"> |
| 32 | + <appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender"> |
32 | 33 |
|
33 | | - <http> |
34 | | - <url>${LOKI_URL}</url> |
35 | | - <connectionTimeoutMs>30000</connectionTimeoutMs> |
36 | | - <requestTimeoutMs>15000</requestTimeoutMs> |
37 | | - <maxRetries>3</maxRetries> |
38 | | - <backoffMs>1000</backoffMs> |
39 | | - </http> |
| 34 | + <http> |
| 35 | + <url>${LOKI_URL}</url> |
| 36 | + <connectionTimeoutMs>30000</connectionTimeoutMs> |
| 37 | + <requestTimeoutMs>15000</requestTimeoutMs> |
| 38 | + <maxRetries>3</maxRetries> |
| 39 | + <backoffMs>1000</backoffMs> |
| 40 | + </http> |
40 | 41 |
|
41 | | - <batchSize>100</batchSize> |
42 | | - <batchTimeoutMs>10000</batchTimeoutMs> |
43 | | - <bufferSize>1048576</bufferSize> |
| 42 | + <batchSize>100</batchSize> |
| 43 | + <batchTimeoutMs>10000</batchTimeoutMs> |
| 44 | + <bufferSize>1048576</bufferSize> |
44 | 45 |
|
45 | | - <format> |
46 | | - <label> |
47 | | - <pattern>app=my-app,host=${HOSTNAME},environment=${ENV:-local},service=${SERVICE_NAME:-somemore}</pattern> |
48 | | - </label> |
49 | | - <message class="com.github.loki4j.logback.JsonLayout"> |
50 | | - <includeTimestamp>true</includeTimestamp> |
51 | | - <includeMDC>true</includeMDC> |
52 | | - <includeThreadName>true</includeThreadName> |
53 | | - <includeLoggerName>true</includeLoggerName> |
54 | | - <jsonFactory>JACKSON</jsonFactory> |
55 | | - <timestampFieldName>@timestamp</timestampFieldName> |
56 | | - <prettyPrint>false</prettyPrint> |
57 | | - <appendLineSeparator>true</appendLineSeparator> |
58 | | - <messageTemplate>${LOG_PATTERN}</messageTemplate> |
59 | | - <timestampFormat>yyyy-MM-dd HH:mm:ss.SSS</timestampFormat> |
60 | | - </message> |
61 | | - <timestampPattern>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampPattern> |
62 | | - </format> |
| 46 | + <format> |
| 47 | + <label> |
| 48 | + <pattern>app=my-app,host=${HOSTNAME},environment=${ENV:-local},service=${SERVICE_NAME:-somemore}</pattern> |
| 49 | + </label> |
| 50 | + <message class="com.github.loki4j.logback.JsonLayout"> |
| 51 | + <includeTimestamp>true</includeTimestamp> |
| 52 | + <includeMDC>true</includeMDC> |
| 53 | + <includeThreadName>true</includeThreadName> |
| 54 | + <includeLoggerName>true</includeLoggerName> |
| 55 | + <jsonFactory>JACKSON</jsonFactory> |
| 56 | + <timestampFieldName>@timestamp</timestampFieldName> |
| 57 | + <prettyPrint>false</prettyPrint> |
| 58 | + <appendLineSeparator>true</appendLineSeparator> |
| 59 | + <messageTemplate>${LOG_PATTERN}</messageTemplate> |
| 60 | + <timestampFormat>yyyy-MM-dd HH:mm:ss.SSS</timestampFormat> |
| 61 | + </message> |
| 62 | + <timestampPattern>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampPattern> |
| 63 | + </format> |
63 | 64 |
|
64 | | - <timeZone>Asia/Seoul</timeZone> |
65 | | - </appender> |
| 65 | + <timeZone>Asia/Seoul</timeZone> |
| 66 | + </appender> |
| 67 | + </springProfile> |
66 | 68 |
|
67 | 69 | <logger name="com.somemore.application" level="DEBUG" additivity="false"> |
68 | 70 | <appender-ref ref="CONSOLE" /> |
|
0 commit comments