Commit a0412c56 authored by wangpeng's avatar wangpeng

增加邮件告警配置

parent 988c6b11
......@@ -64,12 +64,6 @@ public class CustomerBusinessContoller {
private final CacheManager cacheManager;
@GetMapping("/errEMail")
public R<String> errEMail(HttpServletRequest request) throws Exception {
throw new Exception("errEMail异常测试!");
}
/**
* 简单分页查询
* @param page 分页对象
......
......@@ -53,7 +53,6 @@ security:
- /tpreempmain/getPhoneByCardAndName
- /tpreempmain/sendCode
- /tpreempmain/checkCode
- /customerBusiness/customerInfo/errEMail
# 文件上传相关 支持阿里云、华为云、腾讯、minio
......
......@@ -19,27 +19,7 @@
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--邮件提醒-->
<appender name="MAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.exmail.qq.com</smtpHost>
<smtpPort>465</smtpPort>
<username>information@wanxin-holdings.com</username>
<password>QmdCaQSPmCAQEddd</password>
<SSL>true</SSL>
<asynchronousSending>true</asynchronousSending>
<to>wangpeng@wanxin-holdings.com,fangxinjiang@wanxin-holdings.com,hongguangwu@wanxin-holdings.com</to>
<from>information@wanxin-holdings.com</from>
<subject>hro-mvp ${springAppActive}环境 ${springAppName}服务: %-20msg 错误</subject>
<charsetEncoding>UTF-8</charsetEncoding>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<!-- &lt;!&ndash; 每个电子邮件只发送一个日志条目 &ndash;&gt;-->
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<!-- Log file debug output -->
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
......@@ -69,6 +49,27 @@
<level>ERROR</level>
</filter>
</appender>
<!--邮件提醒-->
<appender name="MAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.exmail.qq.com</smtpHost>
<smtpPort>465</smtpPort>
<username>information@wanxin-holdings.com</username>
<password>QmdCaQSPmCAQEddd</password>
<SSL>true</SSL>
<asynchronousSending>true</asynchronousSending>
<to>wangpeng@wanxin-holdings.com,fangxinjiang@wanxin-holdings.com,hongguangwu@wanxin-holdings.com</to>
<from>information@wanxin-holdings.com</from>
<subject>hro-mvp ${springAppActive}环境 ${springAppName}服务: %-20msg 错误</subject>
<charsetEncoding>UTF-8</charsetEncoding>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<!-- &lt;!&ndash; 每个电子邮件只发送一个日志条目 &ndash;&gt;-->
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<springProfile name="prd">
<root level="error">
......@@ -83,7 +84,6 @@
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="test">
......@@ -92,7 +92,6 @@
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
</configuration>
......
......@@ -16,8 +16,9 @@
-->
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/>
<springProperty scop="context" name="springAppName" source="spring.application.name" defaultValue=""/>
<springProperty scop="context" name="springAppActive" source="spring.profiles.active" defaultValue=""/>
<property name="log.path" value="logs/${springAppName}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......@@ -68,10 +69,49 @@
<appender-ref ref="error"/>
</logger>
<!--邮件提醒-->
<appender name="MAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.exmail.qq.com</smtpHost>
<smtpPort>465</smtpPort>
<username>information@wanxin-holdings.com</username>
<password>QmdCaQSPmCAQEddd</password>
<SSL>true</SSL>
<asynchronousSending>true</asynchronousSending>
<to>wangpeng@wanxin-holdings.com,fangxinjiang@wanxin-holdings.com,hongguangwu@wanxin-holdings.com</to>
<from>information@wanxin-holdings.com</from>
<subject>hro-mvp ${springAppActive}环境 ${springAppName}服务: %-20msg 错误</subject>
<charsetEncoding>UTF-8</charsetEncoding>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<!-- &lt;!&ndash; 每个电子邮件只发送一个日志条目 &ndash;&gt;-->
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<springProfile name="prd">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="dev">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
<springProfile name="test">
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="INFO">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/>
<springProperty scop="context" name="springAppName" source="spring.application.name" defaultValue=""/>
<springProperty scop="context" name="springAppActive" source="spring.profiles.active" defaultValue=""/>
<property name="log.path" value="logs/${springAppName}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/>
<springProperty scop="context" name="springAppName" source="spring.application.name" defaultValue=""/>
<springProperty scop="context" name="springAppActive" source="spring.profiles.active" defaultValue=""/>
<property name="log.path" value="logs/${springAppName}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......@@ -48,11 +49,50 @@
</filter>
</appender>
<!--邮件提醒-->
<appender name="MAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.exmail.qq.com</smtpHost>
<smtpPort>465</smtpPort>
<username>information@wanxin-holdings.com</username>
<password>QmdCaQSPmCAQEddd</password>
<SSL>true</SSL>
<asynchronousSending>true</asynchronousSending>
<to>wangpeng@wanxin-holdings.com,fangxinjiang@wanxin-holdings.com,hongguangwu@wanxin-holdings.com</to>
<from>information@wanxin-holdings.com</from>
<subject>hro-mvp ${springAppActive}环境 ${springAppName}服务: %-20msg 错误</subject>
<charsetEncoding>UTF-8</charsetEncoding>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<!-- &lt;!&ndash; 每个电子邮件只发送一个日志条目 &ndash;&gt;-->
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<springProfile name="prd">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="dev">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
<springProfile name="test">
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="INFO">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/>
<springProperty scop="context" name="springAppName" source="spring.application.name" defaultValue=""/>
<springProperty scop="context" name="springAppActive" source="spring.profiles.active" defaultValue=""/>
<property name="log.path" value="logs/${springAppName}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......@@ -49,11 +50,50 @@
</appender>
<!--邮件提醒-->
<appender name="MAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.exmail.qq.com</smtpHost>
<smtpPort>465</smtpPort>
<username>information@wanxin-holdings.com</username>
<password>QmdCaQSPmCAQEddd</password>
<SSL>true</SSL>
<asynchronousSending>true</asynchronousSending>
<to>wangpeng@wanxin-holdings.com,fangxinjiang@wanxin-holdings.com,hongguangwu@wanxin-holdings.com</to>
<from>information@wanxin-holdings.com</from>
<subject>hro-mvp ${springAppActive}环境 ${springAppName}服务: %-20msg 错误</subject>
<charsetEncoding>UTF-8</charsetEncoding>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<!-- &lt;!&ndash; 每个电子邮件只发送一个日志条目 &ndash;&gt;-->
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<springProfile name="prd">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="dev">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
<springProfile name="test">
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/>
<springProperty scop="context" name="springAppName" source="spring.application.name" defaultValue=""/>
<springProperty scop="context" name="springAppActive" source="spring.profiles.active" defaultValue=""/>
<property name="log.path" value="logs/${springAppName}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......@@ -53,11 +54,50 @@
<appender-ref ref="error"/>
</logger>
<!--邮件提醒-->
<appender name="MAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.exmail.qq.com</smtpHost>
<smtpPort>465</smtpPort>
<username>information@wanxin-holdings.com</username>
<password>QmdCaQSPmCAQEddd</password>
<SSL>true</SSL>
<asynchronousSending>true</asynchronousSending>
<to>wangpeng@wanxin-holdings.com,fangxinjiang@wanxin-holdings.com,hongguangwu@wanxin-holdings.com</to>
<from>information@wanxin-holdings.com</from>
<subject>hro-mvp ${springAppActive}环境 ${springAppName}服务: %-20msg 错误</subject>
<charsetEncoding>UTF-8</charsetEncoding>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<!-- &lt;!&ndash; 每个电子邮件只发送一个日志条目 &ndash;&gt;-->
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<springProfile name="prd">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="dev">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
<springProfile name="test">
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/>
<springProperty scop="context" name="springAppName" source="spring.application.name" defaultValue=""/>
<springProperty scop="context" name="springAppActive" source="spring.profiles.active" defaultValue=""/>
<property name="log.path" value="logs/${springAppName}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......@@ -48,12 +49,50 @@
</filter>
</appender>
<!--邮件提醒-->
<appender name="MAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.exmail.qq.com</smtpHost>
<smtpPort>465</smtpPort>
<username>information@wanxin-holdings.com</username>
<password>QmdCaQSPmCAQEddd</password>
<SSL>true</SSL>
<asynchronousSending>true</asynchronousSending>
<to>wangpeng@wanxin-holdings.com,fangxinjiang@wanxin-holdings.com,hongguangwu@wanxin-holdings.com</to>
<from>information@wanxin-holdings.com</from>
<subject>hro-mvp ${springAppActive}环境 ${springAppName}服务: %-20msg 错误</subject>
<charsetEncoding>UTF-8</charsetEncoding>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<!-- &lt;!&ndash; 每个电子邮件只发送一个日志条目 &ndash;&gt;-->
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<springProfile name="prd">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="dev">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
<springProfile name="test">
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
</configuration>
......@@ -16,8 +16,9 @@
-->
<configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/>
<springProperty scop="context" name="springAppName" source="spring.application.name" defaultValue=""/>
<springProperty scop="context" name="springAppActive" source="spring.profiles.active" defaultValue=""/>
<property name="log.path" value="logs/${springAppName}"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
......@@ -63,10 +64,49 @@
</filter>
</appender>
<!--邮件提醒-->
<appender name="MAIL" class="ch.qos.logback.classic.net.SMTPAppender">
<smtpHost>smtp.exmail.qq.com</smtpHost>
<smtpPort>465</smtpPort>
<username>information@wanxin-holdings.com</username>
<password>QmdCaQSPmCAQEddd</password>
<SSL>true</SSL>
<asynchronousSending>true</asynchronousSending>
<to>wangpeng@wanxin-holdings.com,fangxinjiang@wanxin-holdings.com,hongguangwu@wanxin-holdings.com</to>
<from>information@wanxin-holdings.com</from>
<subject>hro-mvp ${springAppActive}环境 ${springAppName}服务: %-20msg 错误</subject>
<charsetEncoding>UTF-8</charsetEncoding>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<!-- &lt;!&ndash; 每个电子邮件只发送一个日志条目 &ndash;&gt;-->
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>ERROR</level>
</filter>
</appender>
<springProfile name="prd">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="dev">
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
<springProfile name="test">
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="error">
<appender-ref ref="console"/>
<appender-ref ref="debug"/>
<appender-ref ref="error"/>
</root>
</springProfile>
</configuration>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment