본문으로 바로가기

log4j2 설정 기록

category SPRING/스프링 2022. 3. 4. 14:14
728x90
반응형
SMALL
name = PropertiesConfig
property.filename = logs/example.log
appenders = console, rolling
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{dd.MM.yyyy HH:mm:ss,SSS}[%t] %-5p %c{1}:%L - %m%n
appender.rolling.type = RollingFile
appender.rolling.name = roll
appender.rolling.fileName = ${filename}
appender.rolling.filePattern = logs/app/%d{MM-dd-yy-HH-mm-ss}-%i.log.gz
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = %d{dd.MM.yyyy HH:mm:ss,SSS} %-5p %c{1}:%L - %m%n
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 2
appender.rolling.policies.time.modulate = true
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=100MB
appender.rolling.strategy.type = DefaultRolloverStrategy
appender.rolling.strategy.max = 5
loggers = rolling
logger.rolling.name = org.apache.logging.log4j.core.appender.rolling
logger.rolling.level = debug
logger.rolling.additivity = true
logger.rolling.appenderRefs = rolling
logger.rolling.appenderRef.rolling.ref = roll
rootLogger.level = debug 
rootLogger.appenderRefs = rolling, stdout 
rootLogger.appenderRef.rolling.ref = roll
rootLogger.appenderRef.stdout.ref = STDOUT

 

728x90
반응형
LIST

'SPRING > 스프링' 카테고리의 다른 글

스프링 파라미터 정리  (0) 2022.09.02
스프링 JDK 버전 호환  (0) 2022.05.31
정리  (0) 2022.03.03
[스프링] HTML 특수문자 JSON 데이터 파싱문제 발생  (0) 2021.11.15
스프링 mapper vs dao 차이  (0) 2021.11.09