Skip to content

Commit b119d4b

Browse files
committed
infra: 환경별 loki 설정 추가
1 parent df955ba commit b119d4b

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/main/resources/application.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ spring:
77
local: console-logging, secret-local
88
test: console-logging
99
dev: console-logging
10-
dev-oci: console-logging
11-
prod: console-logging, sentry-logging
12-
prod-oci: console-logging, sentry-logging
10+
dev-oci: dev-loki
11+
prod: console-logging
12+
prod-oci: prod-loki

src/main/resources/logback-spring.xml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
</root>
1010
</springProfile>
1111

12-
<springProfile name="dev-oci">
12+
<springProfile name="dev-loki">
1313
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
1414
<http>
1515
<url>http://10.0.0.119:3100/loki/api/v1/push</url>
16-
<tenantId>dev</tenantId>
1716
</http>
1817
<format>
19-
<label>
20-
<pattern>app=${spring.application.name},host=${HOSTNAME},level=%level,environment=dev</pattern>
21-
</label>
18+
<labels>
19+
app=yappu-world
20+
host=${HOSTNAME}
21+
level=%level
22+
env=dev
23+
</labels>
2224
<message>
2325
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
2426
</message>
@@ -34,16 +36,18 @@
3436
</root>
3537
</springProfile>
3638

37-
<springProfile name="prod-oci">
39+
<springProfile name="prod-loki">
3840
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
3941
<http>
4042
<url>http://10.0.0.119:3100/loki/api/v1/push</url>
41-
<tenantId>prod</tenantId>
4243
</http>
4344
<format>
44-
<label>
45-
<pattern>app=${spring.application.name},host=${HOSTNAME},level=%level,environment=prod</pattern>
46-
</label>
45+
<labels>
46+
app=yappu-world
47+
host=${HOSTNAME}
48+
level=%level
49+
env=prod
50+
</labels>
4751
<message>
4852
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
4953
</message>

0 commit comments

Comments
 (0)