Skip to content

Commit

Permalink
#338 [feat] rolling file appender 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
KWY0218 committed Jan 18, 2025
1 parent 8bc3bce commit edd69ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
</springProfile>

<springProfile name="!local">
<include resource="file-info-appender.xml"/>
<include resource="file-error-appender.xml"/>
<include resource="prod-rolling-file-appender.xml"/>

<root level="INFO">
<appender-ref ref="FILE-INFO"/>
<appender-ref ref="FILE-ERROR"/>
<appender-ref ref="ROLLING-FILE-LOGGING"/>
</root>
</springProfile>

Expand Down
11 changes: 11 additions & 0 deletions src/main/resources/prod-rolling-file-appender.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<included>
<appender name="ROLLING-FILE-LOGGING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>/logs/info-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
</included>

0 comments on commit edd69ad

Please sign in to comment.