1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <appender name="FILE"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
- <Encoding>UTF-8</Encoding>
- <File>work/log/app.log</File>
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <FileNamePattern>work/log/app.%d{yyyy-MM-dd}.log.gz</FileNamePattern>
- <MaxHistory>30</MaxHistory>
- </rollingPolicy>
- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
- <pattern>%d{HH:mm:ss} %-5level [%thread]%logger{16} - %msg%n
- </pattern>
- </encoder>
- </appender>
-
- <property resource="config.properties" />
- <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
- <smtpHost>${logback.email.smtp_host}</smtpHost>
- <smtpPort>${logback.email.smtp_port}</smtpPort>
- <username>${logback.email.username}</username>
- <password>${logback.email.password}</password>
- <asynchronousSending>true</asynchronousSending>
- <SSL>${logback.email.ssl}</SSL>
- <from>${logback.email.from}</from>
- <to>${logback.email.to}</to>
- <subject>${logback.email.subject}</subject>
- <layout class="ch.qos.logback.classic.html.HTMLLayout">
- <Pattern>%date%level%thread%logger{0}%line%message</Pattern>
- </layout>
- <filter class="ch.qos.logback.classic.filter.LevelFilter">
- <level>ERROR</level>
- <onMatch>ACCEPT</onMatch>
- <onMismatch>DENY</onMismatch>
- </filter>
- <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
- <bufferSize>1</bufferSize>
- </cyclicBufferTracker>
- </appender>
-
- <root level="WARN">
- <appender-ref ref="FILE"/>
- </root>
- </configuration>
|