728x90

pom.xml

<dependencies>
    <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>
</dependencies>
<properties>
    <tinylog.version>2.4.1</tinylog.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.tinylog</groupId>
        <artifactId>tinylog-api</artifactId>
        <version>${tinylog.version}</version>
    </dependency>
    <dependency>
        <groupId>org.tinylog</groupId>
        <artifactId>tinylog-impl</artifactId>
        <version>${tinylog.version}</version>
    </dependency>
    <dependency>
        <groupId>org.tinylog</groupId>
        <artifactId>slf4j-tinylog</artifactId>
        <version>${tinylog.version}</version>
    </dependency>
    <dependency>
        <groupId>org.tinylog</groupId>
        <artifactId>jcl-tinylog</artifactId>
        <version>${tinylog.version}</version>
    </dependency>
    <dependency>
        <groupId>org.tinylog</groupId>
        <artifactId>log4j1.2-api</artifactId>
        <version>${tinylog.version}</version>
    </dependency>

</dependencies>

테스트 코드

@Slf4j
@SpringBootApplication
public class LogDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(LogDemoApplication.class, args);

        log.error("Hello World");
        log.warn("Hello World");
        log.info("Hello World");
        log.debug("Hello World");
        log.trace("Hello World");
    }

}

구동 로그확인

TinylogLogger 가 적용된것을 확인 할수 있다.

resources 폴더 안에 tinylog.properties 파일 생성
writer=console
writer.format={date: HH:mm:ss.SSS} {level}: {message}

Log 출력 상태

끝!


내저장소 바로가기 luxury515

'Springboot2.x 강좌 > 로그의 기본설정' 카테고리의 다른 글

Logback설정  (1) 2023.04.11
Springboot 2.6.x 설정 및 사용  (0) 2023.04.11

+ Recent posts