logback-spring.xml (2172B)
1 <configuration> 2 3 <property name="APP_LOG_ROOT" value="${user.home}/sxcybot/log/"/> 4 <property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n"/> 5 6 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> 7 <encoder> 8 <pattern>${LOG_PATTERN}</pattern> 9 </encoder> 10 </appender> 11 <springProfile name="prd"> 12 <appender name="monitor" class="ch.qos.logback.core.rolling.RollingFileAppender"> 13 <file>${APP_LOG_ROOT}/monitor/monitor.log</file> 14 <encoder> 15 <pattern>${LOG_PATTERN}</pattern> 16 </encoder> 17 <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> 18 <fileNamePattern>${APP_LOG_ROOT}/monitor-%i.log</fileNamePattern> 19 <minIndex>1</minIndex> 20 <maxIndex>10</maxIndex> 21 </rollingPolicy> 22 <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> 23 <maxFileSize>5MB</maxFileSize> 24 </triggeringPolicy> 25 </appender> 26 27 <appender name="logging" class="ch.qos.logback.core.rolling.RollingFileAppender"> 28 <file>${APP_LOG_ROOT}/sxcybot.log</file> 29 <encoder> 30 <pattern>${LOG_PATTERN}</pattern> 31 </encoder> 32 <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> 33 <fileNamePattern>${APP_LOG_ROOT}/sxcybot-%i.log</fileNamePattern> 34 <minIndex>1</minIndex> 35 <maxIndex>10</maxIndex> 36 </rollingPolicy> 37 <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> 38 <maxFileSize>5MB</maxFileSize> 39 </triggeringPolicy> 40 </appender> 41 42 <logger name="monitor" level="INFO"> 43 <appender-ref ref="monitor"/> 44 </logger> 45 46 <root level="INFO"> 47 <appender-ref ref="logging"/> 48 </root> 49 </springProfile> 50 <springProfile name="!prd"> 51 <root level="INFO"> 52 <appender-ref ref="STDOUT"/> 53 </root> 54 </springProfile> 55 </configuration>