* Console 로그
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
[%d{yyyy.MM.dd HH:mm:ss}][%-5level][%logger{36}] - %msg%n
</Pattern>
</layout>
</appender>
<root level="DEBUG"><!-- DEBUG-->
<appender-ref ref="STDOUT" />
</root>
</configuration>
* 로그 화일저장
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>./application_log/application.log</file>
<encoder>
<pattern>%d{yyyyMMdd HH:mm:ss.SSS} [%thread] %-5level [%logger{0}:%line] - %msg %n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>application.log.%d{yyyy-MM-dd}.gz</fileNamePattern>
<maxHistory>30</maxHistory>
<totalSizeCap>5GB</totalSizeCap>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
[%d{yyyy.MM.dd HH:mm:ss}][%-5level][%logger{36}] - %msg%n
</Pattern>
</layout>
</appender>
<root level="DEBUG">
<appender-ref ref="file" />
</root>
</configuration>
'java' 카테고리의 다른 글
ajax 404에러 발생하는 경우 (0) | 2022.07.08 |
---|---|
curl 코드 변환기(converter) (0) | 2022.06.02 |
문자 분할 split 파이프(|) (0) | 2022.05.26 |
IntelliJ 자동 빌드 및 gradle, java 버젼 설정 (0) | 2022.01.25 |
스프링 메일 전송 에러 : 220 2.0.0 Ready to start TLS (0) | 2022.01.04 |