최초 커밋!
This commit is contained in:
54
api/src/main/resources/logback-spring.xml
Normal file
54
api/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
참고문서
|
||||
https://docs.spring.io/spring-boot/docs/1.5.x/reference/html/howto-logging.html
|
||||
스프링부트 Git Repository
|
||||
https://github.com/spring-projects/spring-boot/tree/main/spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback
|
||||
에러 로그파일 생성
|
||||
https://goddaehee.tistory.com/206
|
||||
-->
|
||||
<configuration>
|
||||
<appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="ERROR">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<charset>${FILE_LOG_CHARSET}</charset>
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
<file>${LOG_FILE_ERROR}</file>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<level>error</level>
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_FILE_ERROR}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
<maxHistory>30</maxHistory> <!-- 로그를 30일간 보관 -->
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
<!-- <springProperty scope="context" name="ACTIVE_PROFILE" source="spring.profiles.active"/>-->
|
||||
<!-- <property resource="application-${ACTIVE_PROFILE}.properties"/>-->
|
||||
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
|
||||
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
|
||||
<include resource="org/springframework/boot/logging/logback/file-appender.xml"/>
|
||||
<logger level="ERROR" name="com.amazonaws.util.EC2MetadataUtils"/>
|
||||
|
||||
<property name="APP_LOG_FILE" value="api-app"/>
|
||||
<property name="LOG_FILE" value="${LOG_PATH}/${APP_LOG_FILE}.log"/>
|
||||
|
||||
<!-- ERROR 출력의 경우 (운영 관리의 편리함을 위해) 별도 파일을 추가로 생성해준다. -->
|
||||
<property name="LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN"
|
||||
value="${LOG_FILE}.%d{yyyy-MM-dd}.%i.log"/>
|
||||
|
||||
<property name="LOG_FILE_ERROR" value="${LOG_PATH}/${APP_LOG_FILE}-ERROR.log"/>
|
||||
|
||||
<!-- 시작시 불필요한 오류 제거 (EC2 Metadata Service) -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="FILE"/>
|
||||
<appender-ref ref="ERROR"/>
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user