ryantenney / log4j-redis-appender

log4j appender writing straight to Redis
Other
33 stars 26 forks source link

log4j-redis-appender Build Status

Log4j appender for pushing log messages to a Redis list.

Derived from @pavlobaron's log4j2redis, though the two projects share almost no code. That project writes messages to unique keys as opposed to pushing to a list.

Configuration

This appender pushes log messages to a Redis list. Here is an example configuration:

log4j.rootLogger=DEBUG, redis
log4j.appender.redis=com.ryantenney.log4j.RedisAppender
log4j.appender.redis.layout=…
log4j.appender.redis.host=localhost
log4j.appender.redis.port=6379
log4j.appender.redis.password=password
log4j.appender.redis.key=key
log4j.appender.redis.period=500
log4j.appender.redis.batchSize=100
log4j.appender.redis.purgeOnFailure=true
log4j.appender.redis.alwaysBatch=true
log4j.appender.redis.daemonThread=true

Where:

Maven

<dependency>
    <groupId>com.ryantenney.log4j</groupId>
    <artifactId>redis-appender</artifactId>
    <version>1.0.1</version>
</dependency>

Usage Note

Goes great with @lusis's log4j-jsonevent-layout for pushing log messages straight to a Logstash instance configured to ingest log messages from Redis. If you use Logstash with AMQP, check out @lusis's ZeroMQ Appender or @jbrisbin's RabbitMQ Appender

License

Copyright (c) 2012-2013 Ryan Tenney

Published under Apache Software License 2.0, see LICENSE

Rochester Made