Skip to content

Commit 04813f1

Browse files
committed
chore: 에러 로그 구분
1 parent e43bb28 commit 04813f1

2 files changed

Lines changed: 37 additions & 4 deletions

File tree

fluent-bit-config/fluent-bit.conf

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,44 @@
3434
Parser redis
3535
Reserve_Data On
3636

37-
# CloudWatch로 로그 전송
37+
# ERROR 로그에 별도 태그 붙이기
38+
[FILTER]
39+
Name rewrite_tag
40+
Match spring.*
41+
Rule level ERROR spring-error true
42+
Emitter_Name spring-error-emitter
43+
44+
# 모든 로그를 일반 로그 그룹으로 (spring)
45+
[OUTPUT]
46+
Name cloudwatch_logs
47+
Match spring.blue
48+
region ap-northeast-2
49+
log_group_name doomz-spring-app
50+
log_stream_prefix blue-
51+
auto_create_group true
52+
3853
[OUTPUT]
3954
Name cloudwatch_logs
40-
Match *
55+
Match spring.green
4156
region ap-northeast-2
4257
log_group_name doomz-spring-app
43-
log_stream_prefix ${TAG}-
58+
log_stream_prefix green-
59+
auto_create_group true
60+
61+
# Redis 로그
62+
[OUTPUT]
63+
Name cloudwatch_logs
64+
Match redis.service
65+
region ap-northeast-2
66+
log_group_name doomz-spring-app
67+
log_stream_prefix redis-
68+
auto_create_group true
69+
70+
# ERROR 로그만 별도 로그 그룹으로
71+
[OUTPUT]
72+
Name cloudwatch_logs
73+
Match spring-error
74+
region ap-northeast-2
75+
log_group_name doomz-spring-app-errors
76+
log_stream_prefix error-
4477
auto_create_group true

fluent-bit-config/parsers.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
Format regex
1111
Regex ^(?<time>\d{2}:\d{2}:\d{2}\.\d+) (?<level>\S+) (?<message>.*)$
1212
Time_Format %H:%M:%S.%L
13-
Time_Keep On
13+
Time_Keep On

0 commit comments

Comments
 (0)