1. Logback 기본 설정
- application.properties
logging.charset.file=UTF-8
logging.logback.rollingpolicy.max-history=7
logging.logback.rollingpolicy.max-file-size=10MB
logging.logback.rollingpolicy.file-name-pattern=D:/logs/store/backoffice.%d{yyyy-MM-dd}.%i.gz
logging.pattern.file=%-5level %d{YY.MM.dd HH:mm} [ %logger{32}:%line ] %msg%n
logging.pattern.console=%-5level %d{YY.MM.dd HH:mm} [ %logger{32}:%line ] %msg%n
logging.file.name=D:/logs/store/backoffice/backoffice.log
2. Logging Group 설정
- application.properties
logging.group.framework=org.apache,org.springframework,org.mybatis
logging.group.etc=log4jdbc.debug
logging.group.db=com.zaxxer.hikari
logging.group.jdbc-viewer=jdbc.sqltiming,jdbc.resultsettable
logging.group.jdbc-off=jdbc,jdbc.connection,jdbc.sqlonly,jdbc.audit,jdbc.resultset,jdbc.connection
logging.group.off=co.kr.store.bo.Application
3. Logging Group별 Log Level 설정
- application.properties
logging.level.fwork=info
logging.level.etc=warn
logging.level.db=error
logging.level.jdbc-viewer=info
logging.level.jdbc-off=off
logging.level.off=off
logging.level.co.kr.store=info
logging.level.root=debug
'[Java] > [Spring]' 카테고리의 다른 글
[SpringBoot] Redis 설정 ( RedisTemplate 사용 ) (0) | 2024.09.12 |
---|---|
[SpringBoot] Database Logging 설정 (0) | 2024.08.27 |
[SpringBoot] Jasypt 설정( 프로퍼티 암호화 ) (0) | 2024.08.26 |
[SpringBoot] Thymeleaf 설정 (0) | 2024.08.26 |
[SpringBoot] MyBatis 설정 (0) | 2024.08.26 |