Skip to content

Very simple Logback appender to see the logs on your Slack account

Notifications You must be signed in to change notification settings

KentaKomai/logback-slack-appender

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is very simple Logback appender to see the logs on your Slack account also.

How to setup

Copy com.wpic.logback.SlackAppender.java to your source directory

Add SlackAppender configuration to logback.xml file

<?xml version="1.0" encoding="UTF-8" ?>
	<configuration>
	
	<!-- Setup appender -->
	<appender name="SLACK" class="com.wpic.logback.SlackAppender">
		<!-- API token - Get it from here: https://api.slack.com/ -->
		<token>1111111111-1111111-11111111-111111111</token>
		<!-- Channel that you want to post - default is #general -->
		<channel>#api-test</channel>
		<!-- Bot's username - default is 'bot' -->
		<username>Error Notification!</username>
		<!-- Bot's icon that does not contain a colon(:)-->
		<iconEmoji>persevere</iconEmoji>
		<!-- Formatting -->
		<layout class="ch.qos.logback.classic.PatternLayout">
			<pattern>%-4relative [%thread] %-5level %class - %msg%n</pattern>
		</layout>
	</appender>

	<root>
		<level value="ALL" />
		<appender-ref ref="SLACK" />
	</root>

</configuration>

Done!

About

Very simple Logback appender to see the logs on your Slack account

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 94.9%
  • Scala 5.1%