<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
logging.config=classpath:log4j2.xml
resource 폴더 에 log4j2.xml 파일 생성.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
여기서 궁금한것 그램 내가 위에서 적용한 로그 모듈이 log4j2 인지 아니면 기존 Logback 인지 어떻게 알지? 방법은 간단하다. debug 모드로 실행후 임의 포인트를 찍고 로그상태를 확인 해보면 알수 있다.
새로 적용된 Log4j2 경우.