Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20210506] (Spring) 로깅 프레임워크 - logback #118

Open
JuHyun419 opened this issue May 6, 2021 · 0 comments
Open

[20210506] (Spring) 로깅 프레임워크 - logback #118

JuHyun419 opened this issue May 6, 2021 · 0 comments
Labels

Comments

@JuHyun419
Copy link
Owner

logback - 로깅 프레임워크

  • 보통 스프링 부트에서 사용을 하나 현재 스프링에서 사용중... 😢
  • logback 설정은 appender, logger, root 으로 나뉨
    • appender: 어디에, 어떻게 로그를 찍을 지 설정
    • logger: 해당 appender을 참조하며 해당 로거가 사용될 패키지 및 로그 레벨 지정
    • root: root 레벨 설정
  • appender에는 ConsoleAppender(콘솔에 로그 출력), RollingFileAppender(파일 관련) 등이 있음
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>test.log</File>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%date{MM-dd HH:mm:ss.SSS} %-10.10thread %-5level %logger{35} %5line %msg%n</pattern>
        </layout>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>test.%d{yyyy-MM-dd}.log</fileNamePattern>
        </rollingPolicy>
    </appender>

...

    <root level="INFO">
        <appender-ref ref="FILE" />
    </root>

참고

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant