Logstash Logback Encoder bundle for Dropwizard

Addon bundle for Dropwizard to support logging in json format that can be consumed as-is by tools like Logstash or Graylog2

Лицензия

Лицензия

Категории

Категории

Сеть Logback Библиотеки уровня приложения Logging Logstash
Группа

Группа

net.devlab722
Идентификатор

Идентификатор

logstash-logback-encoder-bundle
Последняя версия

Последняя версия

0.6.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

Logstash Logback Encoder bundle for Dropwizard
Addon bundle for Dropwizard to support logging in json format that can be consumed as-is by tools like Logstash or Graylog2
Ссылка на сайт

Ссылка на сайт

https://github.com/looztra/logstash-logback-encoder-bundle
Система контроля версий

Система контроля версий

https://github.com/looztra/logstash-logback-encoder-bundle

Скачать logstash-logback-encoder-bundle

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/net.devlab722/logstash-logback-encoder-bundle/ -->
<dependency>
    <groupId>net.devlab722</groupId>
    <artifactId>logstash-logback-encoder-bundle</artifactId>
    <version>0.6.2</version>
</dependency>
// https://jarcasting.com/artifacts/net.devlab722/logstash-logback-encoder-bundle/
implementation 'net.devlab722:logstash-logback-encoder-bundle:0.6.2'
// https://jarcasting.com/artifacts/net.devlab722/logstash-logback-encoder-bundle/
implementation ("net.devlab722:logstash-logback-encoder-bundle:0.6.2")
'net.devlab722:logstash-logback-encoder-bundle:jar:0.6.2'
<dependency org="net.devlab722" name="logstash-logback-encoder-bundle" rev="0.6.2">
  <artifact name="logstash-logback-encoder-bundle" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.devlab722', module='logstash-logback-encoder-bundle', version='0.6.2')
)
libraryDependencies += "net.devlab722" % "logstash-logback-encoder-bundle" % "0.6.2"
[net.devlab722/logstash-logback-encoder-bundle "0.6.2"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
com.yammer.dropwizard : dropwizard-core jar 0.6.2
net.logstash.logback : logstash-logback-encoder jar 1.3
org.assertj : assertj-core jar 1.5.0

provided (1)

Идентификатор библиотеки Тип Версия
org.projectlombok : lombok jar 0.12.0

test (1)

Идентификатор библиотеки Тип Версия
org.testng : testng jar 6.8.5

Модули Проекта

Данный проект не имеет модулей.

Logstash Logback Encoder Bundle

Build Status

Dropwizard bundle that uses the Logstash Logback Encoder to provide logs ready to be consumed by Logstash and co.

Greatly inspired by the Gelf bundle for dropwizard.

Get it

0.6.2 release version available. Snapshots are available in Sonatype OSS snapshots repo

	<dependency>
	  <groupId>net.devlab722</groupId>
	  <artifactId>logstash-logback-encoder-bundle</artifactId>
	  <version>0.6.2</version>
	</dependency>

Usage

The Logstash Logback Encoder Bundle consists in a ConfiguredBundle.

To enable the LogstashLogbackEncoderBundle and specify which part of your configuration will support the bundle configuration, simply add the following code to your Service's initialize method:

    @Override
    public void initialize(Bootstrap<MyServiceConfiguration> bootstrap) {
        bootstrap.addBundle(new LogstashLogbackEncoderBundle<MyServiceConfiguration>() {
                @Override
                public LogstashLogbackEncoderConfiguration getConfiguration(MyServiceConfiguration configuration) {
                    return configuration.getLogstashLogbackEncoderConfiguration();
                }
            });
    }

You also need to add a field for LogstashLogbackEncoderConfiguration to your own Configuration class.

You can have a look at a sample project using it available at https://bitbucket.org/looztra/dropwizzardsample (see configuration file and service java file

Configuration

The LogstashLogbackEncoderConfiguration inherits its properties from the LoggingConfiguration.FileConfiguration and provides an additionnal property includeCallerInfo to include or not the callerInfo (warning getting the callerInfo is an expensive operation that should not be set to true on production environments)

TODO

  • provide adjustments for the upcoming 0.7.0 version of dropwizard

Версии библиотеки

Версия
0.6.2