앱)logback.xml sample example
<?xml version"1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="1 seconds">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}][%-5level][%logger] %msg%n</pattern>
</endcoder>
</appender>
<appender name="SERVICE_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>c:/test/service.log.%d{yyyy-MM-dd-HH}</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}][%-5level][%logger] %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="SERVICE_LOG" />
</root>
<logger name="SERVICE_LOGGER" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE" />
</logger>
</configuration>
<configuration scan="true" scanPeriod="1 seconds">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}][%-5level][%logger] %msg%n</pattern>
</endcoder>
</appender>
<appender name="SERVICE_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>c:/test/service.log.%d{yyyy-MM-dd-HH}</fileNamePattern>
</rollingPolicy>
<encoder>
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}][%-5level][%logger] %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="SERVICE_LOG" />
</root>
<logger name="SERVICE_LOGGER" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE" />
</logger>
</configuration>
'백엔드개발 > 자바스프링' 카테고리의 다른 글
앱)jar 파일 실행하는 법 정리 (0) | 2018.04.13 |
---|---|
스프링 프레임워크 메인 프로젝트 Spring framework project (0) | 2018.04.05 |
앱)loggerutil 자바 common 코드 (0) | 2018.04.02 |
앱)aesciperutil 자바 common 코드 (0) | 2018.04.02 |
앱)md5util 자바 common 코드 (0) | 2018.04.02 |