wasala | d8e4e88 | 2018-03-28 14:20:58 +0200 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <configuration> |
wasala | 6930f1f | 2018-04-05 15:01:38 +0200 | [diff] [blame] | 3 | <include resource="org/springframework/boot/logging/logback/defaults.xml"/> |
| 4 | <property name="LOG_FILE" |
| 5 | value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}spring.log}"/> |
wasala | d8e4e88 | 2018-03-28 14:20:58 +0200 | [diff] [blame] | 6 | |
wasala | 6930f1f | 2018-04-05 15:01:38 +0200 | [diff] [blame] | 7 | <springProfile name="dev"> |
| 8 | <include resource="org/springframework/boot/logging/logback/console-appender.xml"/> |
| 9 | <appender name="ROLLING-FILE" |
| 10 | class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 11 | <encoder> |
| 12 | <pattern>${FILE_LOG_PATTERN}</pattern> |
| 13 | </encoder> |
| 14 | <file>${LOG_FILE}</file> |
| 15 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 16 | <fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.log</fileNamePattern> |
| 17 | </rollingPolicy> |
| 18 | </appender> |
| 19 | <root level="ERROR"> |
| 20 | <appender-ref ref="CONSOLE"/> |
| 21 | <appender-ref ref="ROLLING-FILE"/> |
| 22 | </root> |
| 23 | </springProfile> |
wasala | d8e4e88 | 2018-03-28 14:20:58 +0200 | [diff] [blame] | 24 | |
wasala | 6930f1f | 2018-04-05 15:01:38 +0200 | [diff] [blame] | 25 | <springProfile name="prod"> |
| 26 | <appender name="ROLLING-FILE" |
| 27 | class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 28 | <encoder> |
| 29 | <pattern>${FILE_LOG_PATTERN}</pattern> |
| 30 | </encoder> |
| 31 | <file>${LOG_FILE}</file> |
| 32 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 33 | <fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz</fileNamePattern> |
| 34 | <timeBasedFileNamingAndTriggeringPolicy |
| 35 | class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 36 | <maxFileSize>10MB</maxFileSize> |
| 37 | </timeBasedFileNamingAndTriggeringPolicy> |
| 38 | </rollingPolicy> |
| 39 | </appender> |
| 40 | |
| 41 | <root level="ERROR"> |
| 42 | <appender-ref ref="ROLLING-FILE"/> |
| 43 | </root> |
| 44 | </springProfile> |
wasala | d8e4e88 | 2018-03-28 14:20:58 +0200 | [diff] [blame] | 45 | </configuration> |