250x250
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- JavaScript
- Docker
- Core Java
- Exception
- Eclipse
- ubuntu
- PostgreSQL
- git
- MySQL
- 설정
- JDBC
- error
- STS
- maven
- Tomcat
- Thymeleaf
- SpringBoot
- 오픈소스
- 문서
- Python
- jpa
- MSSQL
- myBatis
- AJAX
- oracle
- IntelliJ
- spring
- Spring Boot
- Source
- Open Source
Archives
- Today
- Total
헤르메스 LIFE
[Spring Boot] logbak-local 설정 본문
728x90
Spring Boot 개발 시 logbak-local 설정이 적용이 안되서 찾아 보니 아래와 같이 설정해야 한다고 합니다.
개발환경
Tools : STS 4.22.1.RELEASE
JDK : zulu11.72.19-jdk11.0.23
Framework : Spring Boot 2.7.18
Logging : Logback 1.2.12
`-Dspring.profiles.active=local` 설정
application.yml
# Spring 설정
spring:
application: # Application 이름
name: ezpus
profiles:
active: local # `-Dspring.profiles.active=local` Default 설정
logging:
config: classpath:logback-${spring.profiles.active}.xml
logback-local.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5level %d{yy-MM-dd HH:mm:SSS}[%thread]>>[%30logger.%method:%line] - %msg%n</pattern>
</encoder>
</appender>
<logger name="jdbc" level="OFF"/>
<logger name="jdbc.sqlonly" level="OFF"/>
<logger name="jdbc.sqltiming" level="OFF"/>
<logger name="jdbc.audit" level="OFF"/>
<logger name="jdbc.resultset" level="OFF"/>
<logger name="jdbc.resultsettable" level="OFF"/>
<logger name="jdbc.connection" level="INFO"/>
<logger name="cspi.ezpus" level="debug" additivity="false">
<!-- ref="appender name 지정" -->
<appender-ref ref="STDOUT" />
<!-- <appender-ref ref="ROLLING-FILE" /> -->
</logger>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
logback-prod.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5level %d{yy-MM-dd HH:mm:SSS}[%thread]>>[%30logger.%method:%line] - %msg%n</pattern>
</encoder>
</appender>
<logger name="jdbc" level="OFF"/>
<logger name="jdbc.sqlonly" level="OFF"/>
<logger name="jdbc.sqltiming" level="OFF"/>
<logger name="jdbc.audit" level="OFF"/>
<logger name="jdbc.resultset" level="OFF"/>
<logger name="jdbc.resultsettable" level="OFF"/>
<logger name="jdbc.connection" level="INFO"/>
<root level="WARN">
<appender-ref ref="STDOUT" />
</root>
</configuration>
https://dadadamarine.github.io/java/spring/2019/05/01/spring-logging-xml.html
728x90
'Spring Boot Framework' 카테고리의 다른 글
[SpringBoot] SpringBoot + Redis Cache Sample (0) | 2024.07.31 |
---|---|
[Springboot] Springboot 와 Mybatis 설정에서 resultType을 Map 으로 사용 시 문제점. (0) | 2024.07.24 |
[Spring Boot] Mybatis 쿼리 Interceptor 처리 테스트 (0) | 2024.05.23 |
[Spring Cloud Netflix] Eureka Gateway 샘플 (0) | 2024.03.28 |
[Spring Cloud Netflix] Eureka Client 샘플 (0) | 2024.03.14 |