Commit b40a2da0 authored by wangpeng's avatar wangpeng

邮件测试

parent c00df26d
...@@ -33,6 +33,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -33,6 +33,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -62,6 +63,13 @@ public class CustomerBusinessContoller { ...@@ -62,6 +63,13 @@ public class CustomerBusinessContoller {
private final UpmsDaprUtils upmsDaprUtils; private final UpmsDaprUtils upmsDaprUtils;
private final CacheManager cacheManager; private final CacheManager cacheManager;
@GetMapping("/errEMail")
public R<String> errEMail(HttpServletRequest request) throws Exception {
throw new Exception("errEMail异常测试!");
}
/** /**
* 简单分页查询 * 简单分页查询
* @param page 分页对象 * @param page 分页对象
......
...@@ -53,7 +53,7 @@ security: ...@@ -53,7 +53,7 @@ security:
- /tpreempmain/getPhoneByCardAndName - /tpreempmain/getPhoneByCardAndName
- /tpreempmain/sendCode - /tpreempmain/sendCode
- /tpreempmain/checkCode - /tpreempmain/checkCode
- /customerBusiness/customerInfo/errEMail
# 文件上传相关 支持阿里云、华为云、腾讯、minio # 文件上传相关 支持阿里云、华为云、腾讯、minio
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="false"> <configuration debug="false" scan="false">
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/> <springProperty scop="context" name="springAppName" source="spring.application.name" defaultValue=""/>
<property name="log.path" value="logs/${spring.application.name}"/> <springProperty scop="context" name="springAppActive" source="spring.profiles.active" defaultValue=""/>
<property name="log.path" value="logs/${springAppName}"/>
<!-- 彩色日志格式 --> <!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" <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}}"/> 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}}"/>
...@@ -18,6 +19,27 @@ ...@@ -18,6 +19,27 @@
<pattern>${CONSOLE_LOG_PATTERN}</pattern> <pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder> </encoder>
</appender> </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,chenyuxi@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 --> <!-- Log file debug output -->
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
...@@ -48,12 +70,29 @@ ...@@ -48,12 +70,29 @@
</filter> </filter>
</appender> </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"/>
<appender-ref ref="MAIL"/>
</root>
</springProfile>
<springProfile name="test">
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 --> <!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
<root level="error"> <root level="error">
<appender-ref ref="console"/> <appender-ref ref="console"/>
<appender-ref ref="debug"/> <appender-ref ref="debug"/>
<appender-ref ref="error"/> <appender-ref ref="error"/>
</root> </root>
</springProfile>
</configuration> </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