Dropwizard logging add-on for dropwizard to log using the fluent-logger. This is needed because Dropwizard overwrites the default mechanism for loading logback configuration (logback.xml) in favor of its application.yml files. Configuration options are strongly inspired by the dropwizard-logstash-encoder. The 0.12.x series of this library is tested against
Maven:
<dependency>
<groupId>io.github.georgespalding</groupId>
<artifactId>dropwizard-fluent-appender</artifactId>
<version>${dropwizard-fluent-appender.version}</version>
</dependency>
(See release tags for the appropriate value for dropwizard-fluent-appender.version
)
Configure dropwizard to use these appenders in your application.yml file:
logging:
appenders:
- type: fluent
...
Additional configuration keys for the appender
host
- string (defaultlocalhost
)port
- int (default24224
)reconnectionDelay
- Duration (default30s
acceptConnectionTimeout
- Duration (default5s
)encoder
type
- encoder version, one of [v0
,v1
]tag
- Optional tag (defaultdropwizard.
+ application name)
Example config:
logging:
appenders:
- type: fluent
host: ${FLUENTD_HOST}
port: ${FLUENTD_PORT}
encoder:
type: v0
tag: "dropwizard.TestApplication"
Note: To make ${vars}
work, it is required that a SubstitutingSourceProvider
is configured in your application.
To be implemented