Skip to content

logback appender to push log messages to a Microsoft Teams webhook

Notifications You must be signed in to change notification settings

michl-b/logback-msteams-appender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple Logback appender which pushes logs to MsTeams channel.

Download

How to setup

Add the following settings to you pom.xml.

    <dependency>
      <groupId>com.github.michl-b</groupId>
      <artifactId>logback-msteams-appender</artifactId>
      <version>1.0.2</version>
    </dependency>

  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>bintray jcenter</id>
      <name>bintray</name>
      <url>https://jcenter.bintray.com</url>
    </repository>
  </repositories>

Add MsTeamsAppender configuration to logback.xml or logback-spring.xml file.

<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
  ...

  <appender name="MSTEAMS" class="de.smartthingssimple.basar.logback.MsTeamsAppender">
    <appName>AppName</appName>
    <webhookUri>your web hook from ms teams</webhookUri>
  </appender>
  
  <appender name="ASYNC_MSTEAMS" class="ch.qos.logback.classic.AsyncAppender">
    <appender-ref ref="MSTEAMS" />
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>WARN</level>
    </filter>
  </appender>

  <root level="INFO">
    <appender-ref ref="ASYNC_MSTEAMS" />
  </root>

</configuration>

build a release

Publish artifact in a new version to bintray https://bintray.com/michl-b/logback-msteams-appender/logback-msteams-appender

mvn release:prepare
mvn release:perform

About

logback appender to push log messages to a Microsoft Teams webhook

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages