Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Sumo Logic Logback Appender

License

Notifications You must be signed in to change notification settings

vital-software/sumo-logback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sumo Logic Logback Appender

Create a Logback compatible Appender for sending data to SumoLogic.com. This is useful if you run a Play Framework or Akka Server both of which use Logback over Log4J.

#Installation

resolvers += Resolver.sonatypeRepo("releases")
resolvers += Resolver.sonatypeRepo("snapshots")
libraryDependencies += "com.github.vital-software" %% "sumo-logback" % "0.2-SNAPSHOT"

In your logback.xml file:

 <appender name="SUMOLOGBACK" class="com.github.vitalsoftware.logging.SumoLogicAppender">
   <url>[collector URL created on SumoLogic.com]</url>
   <encoder>
     <pattern>%date{yyyy-MM-dd HH:mm:ss,SSS Z} [%level] from %logger - %message%n%xException</pattern>
   </encoder>
 </appender>
 
 <appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
   <appender-ref ref="SUMOLOGBACK" />
 </appender>
 
 <root level="DEBUG">
   <appender-ref ref="ASYNC" />
 </root>

Be sure to wrap your appender in an AsyncAppender so that log events do not block the current thread.

Dependencies

Future Work

SumoLogic supports proxy's, configurable timeouts, etc. This system hardcodes all the default values in the Log4J implementation. If you need to configure these, create a set{VarName} method inside SumoLogicAppender.scala and set an XML tag 1234. Then be a pal and do a pull request for the rest of us.

About

Sumo Logic Logback Appender

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages