Skip to content

Logback encoder which creates JSON for use with Logstash

License

Notifications You must be signed in to change notification settings

finn-no/logstash-logback-encoder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logback JSON encoder for Logstash

Coming soon, a better README!

Use it in your logback.xml like this:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appender name="stash" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>info</level>
        </filter>
        <file>/some/path/to/your/file.log</file>
        <encoder class="com.github.neilprosser.logstash.LogstashEncoder">
            <source>source</source> <!-- This is optional -->
        </encoder>
    </appender>
    <root level="all">
        <appender-ref ref="stash" />
    </root>
</configuration>

Use it in your logstash configuration like this:

input {
  file {
    type => "your-log-type"
    path => "/some/path/to/your/file.log"
    format => "json_event"
  }
}

About

Logback encoder which creates JSON for use with Logstash

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%