Skip to content

dadapush/dadapush-logback-appender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Logback DaDaPush Notification Appender

Usage

add dependency

<dependency>
  <groupId>com.dadapush.client</groupId>
  <artifactId>dadapush-logback-appender</artifactId>
  <version>1.0.1</version>
</dependency>

define appender

  <appender name="DADAPUSH" class="com.dadapush.client.logback.DaDaPushAppender">

    <!-- basePath default value: https://www.dadapush.com -->
     <basePath>https://www.dadapush.com</basePath> 
    <channelToken>YOUR_CHANNEL_TOKEN</channelToken>

    <titleLayout class="ch.qos.logback.classic.PatternLayout">
      <pattern>[%-5level] %class</pattern>
    </titleLayout>
    <contentLayout class="ch.qos.logback.classic.PatternLayout">
      <pattern>Level: %-5level\nLoggerName: %class\nMessage: %msg%n</pattern>
    </contentLayout>
  </appender>

  <appender name="DADAPUSH_ASYNC" class="ch.qos.logback.classic.AsyncAppender">
    <appender-ref ref="DADAPUSH" />
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>ERROR</level>
    </filter>
  </appender>

use appender

  <root level="info">
    <appender-ref ref="DADAPUSH_ASYNC" />
  </root>