Skip to content

Commit

Permalink
chore: logback ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
jemlog committed Apr 26, 2024
1 parent a3c84b3 commit 38a1cdc
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<timestamp key="BY_DATE" datePattern="yyyy-MM-dd"/>
<property name="LOG_PATTERN" value="[${PID:-}:] [%d{yyyy-MM-dd HH:mm:ss}:%-4relative] %red([%thread]) %highlight(%-5level) %blue([%C.%M:%yellow(%L)]) - %msg%n"/>

<springProfile name="local, test">
<springProfile name="local, test, dev">

<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
Expand All @@ -19,48 +19,48 @@
</springProfile>


<springProfile name="dev, prod">
<!-- <springProfile name="dev, prod">-->

<appender name="FILE-INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/home/ec2-user/log/info/info-${BY_DATE}.log</file>
<filter class = "ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern> /home/ec2-user/backup/info/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
</rollingPolicy>
</appender>
<!-- <appender name="FILE-INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!-- <file>/home/ec2-user/log/info/info-${BY_DATE}.log</file>-->
<!-- <filter class = "ch.qos.logback.classic.filter.LevelFilter">-->
<!-- <level>INFO</level>-->
<!-- <onMatch>ACCEPT</onMatch>-->
<!-- <onMismatch>DENY</onMismatch>-->
<!-- </filter>-->
<!-- <encoder>-->
<!-- <pattern>${LOG_PATTERN}</pattern>-->
<!-- </encoder>-->
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">-->
<!-- <fileNamePattern> /home/ec2-user/backup/info/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>-->
<!-- <maxFileSize>100MB</maxFileSize>-->
<!-- <maxHistory>30</maxHistory>-->
<!-- <totalSizeCap>1GB</totalSizeCap>-->
<!-- </rollingPolicy>-->
<!-- </appender>-->

<appender name="FILE-ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/home/ec2-user/log/error/error-${BY_DATE}.log</file>
<filter class = "ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern> /home/ec2-user/backup/error/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>1GB</totalSizeCap>
</rollingPolicy>
</appender>
<!-- <appender name="FILE-ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
<!-- <file>/home/ec2-user/log/error/error-${BY_DATE}.log</file>-->
<!-- <filter class = "ch.qos.logback.classic.filter.LevelFilter">-->
<!-- <level>ERROR</level>-->
<!-- <onMatch>ACCEPT</onMatch>-->
<!-- <onMismatch>DENY</onMismatch>-->
<!-- </filter>-->
<!-- <encoder>-->
<!-- <pattern>${LOG_PATTERN}</pattern>-->
<!-- </encoder>-->
<!-- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">-->
<!-- <fileNamePattern> /home/ec2-user/backup/error/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>-->
<!-- <maxFileSize>100MB</maxFileSize>-->
<!-- <maxHistory>30</maxHistory>-->
<!-- <totalSizeCap>1GB</totalSizeCap>-->
<!-- </rollingPolicy>-->
<!-- </appender>-->

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

</springProfile>
<!-- </springProfile>-->
</configuration>

0 comments on commit 38a1cdc

Please sign in to comment.