Skip to content

Commit

Permalink
feat: 로그 모니터링 환경 구축 (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
khabh authored Jul 31, 2024
1 parent fb3acc5 commit fda3f0d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
Expand Down
17 changes: 17 additions & 0 deletions server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ cors:
max-age: 3600
allowed-origins: http://localhost:3000, https://haengdong.pro, https://dev.haengdong.pro, https://app.haengdong.pro

management:
endpoints:
web:
exposure:
include: logfile

logging:
level:
root: info
org.springframework.web: debug
server.haengdong: debug

file:
name: logs/spring-boot-application.log
path: logs
config: classpath:logback-spring.xml

---

spring:
Expand Down
19 changes: 19 additions & 0 deletions server/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<configuration>
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/spring-boot-application.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logs/spring-boot-application.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} - %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="ROLLING"/>
</root>

<logger name="org.springframework.web" level="DEBUG"/>
<logger name="server.haengdong" level="DEBUG"/>
</configuration>

0 comments on commit fda3f0d

Please sign in to comment.