Spring Boot 监控信息邮件报警通知

在Spring Boot Admin Server中 进行设置

1.添加依赖

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-mail</artifactId>
	</dependency>

2.application.properties中设置

server.port=8888

spring.mail.host=smtp.sina.com
spring.mail.port=465 //smtp是587或465,如465不能正常使用,可以更换587试试
spring.mail.username=xxx@sina.com
spring.mail.password=授权码
spring.mail.default-encoding=utf-8
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.debug= true
spring.boot.admin.notify.mail.from=xxx@sina.com//发送邮件
spring.boot.admin.notify.mail.to=xxx@163.com//接受邮箱 
spring.boot.admin.notify.mail.ignore-changes=    //忽略掉的事件,这里表示被监控应用 的任何变化都会发送邮件

邮箱开通https://blog.csdn.net/kangguang/article/details/104508566

Spring Boot 监控信息可视化:https://blog.csdn.net/kangguang/article/details/104507340

3.设置 完成后重启应用

4.邮箱接收到的信息

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值