Skip to content

错误日志报警starter,ERROR级别的日志通过企业微信或者钉钉实时报警。支持logback,支持log4j2。

Notifications You must be signed in to change notification settings

atonglvv/alarm-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

alarm-spring-boot-starter

Quick start | FAQs | Report an issue

alarm-spring-boot-starter will help you to View error logs from compony-wechat or DingDing.

JDK compatibility: 1.8

Quick-start

Maven

    <dependency>
        <groupId>cn.atong.leek</groupId>
        <artifactId>alarm-spring-boot-starter</artifactId>
        <version>1.0.1</version>
    </dependency>

application.yml

alarm:
  address: [dingding or compony-wechat reboot webHook]
  mode: [dingding/companyWeChat; default:dingding]
spring:
  application:
    name: [your app name]
  profiles:
    active: [for example dev]

logback

指定 logback appender 的 Filter,如下:

    <!--控制日志输出位置的Appender-->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
    <filter class="cn.atong.leek.alarm.filter.AlarmFilter"/>
    <!--日志消息格式的配置-->
    <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
        <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %C.%M:%L - [traceId:%X{traceId}] [businessId:%X{businessId}]
            %m%n
        </pattern>
    </encoder>
</appender>

Version

1.0.2 可过滤自定义业务异常

FAQs

Contact

wechat : GaiBianShiJieOvO

gmail : [email protected]

About

错误日志报警starter,ERROR级别的日志通过企业微信或者钉钉实时报警。支持logback,支持log4j2。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages