Skip to content

Commit

Permalink
chore : 파일 로그 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
JunHwan Kim committed Feb 9, 2024
1 parent 76e8706 commit 9bc7da4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
distribution: 'temurin'

- uses : actions/checkout@v3
- run : mkdir ./src/main/resources/
# - run : mkdir ./src/main/resources/
- run : touch ./src/main/resources/application.yml
- run : echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.yml
- run : cat ./src/main/resources/application.yml
Expand Down
21 changes: 21 additions & 0 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<configuration scan="true" scanPeriod="30 seconds">
<property resource="application.yml"/>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>./application-${server.port}-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxHistory>7</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="FILE" />
</root>
</configuration>

0 comments on commit 9bc7da4

Please sign in to comment.