참고 : http://logback.qos.ch/manual/layouts.html
Conversion Pattern | Description |
---|---|
%thread | 실행 쓰레트 명 |
%msg | 로깅 내용 |
%n | 개행 문자(new line 출력) |
%-5level | 로깅 레벨(error, warn, info, debug, trace) 출력, 고정폭(5자리), 로깅 레벨이 info일 경우 빈칸 하나 추가 |
%d{yyyy-MM-dd HH:mm:ss.SSS} | 로깅하고 있는 현재 시간, 시.분.초.밀리초 |
%logger | 패키지 포함 클래스 정보 |
%logger{0} | 패키지를 제외한 클래스 이름만 출력 |
%method | 로깅하고 있는 클래스의 메소드 |
%line | 로깅하고 있는 클래스 소스의 line |
logback.xml
<?xml version="1.0" encoding="UTF-8"?> <configuration scan="true" scanPeriod="30 seconds"> <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>[%-5level] [%d{HH:mm:ss.SSS}] [%-4relative] [%mdc] [%logger.%method][%line] [%thread] - %msg%n</pattern> </encoder> </appender> <root level="debug"> <appender-ref ref="console"/> </root> </configuration>