GithubHelp home page GithubHelp logo

mijinco0612 / log4j-redis-appender Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ryantenney/log4j-redis-appender

0.0 2.0 0.0 171 KB

log4j appender writing straight to Redis

License: Other

Makefile 1.22% Java 98.78%

log4j-redis-appender's Introduction

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:

  • key (required) key of the list to push log messages
  • host (optional, default: localhost)
  • port (optional, default: 6379)
  • password (optional) redis password, if required
  • period (optional, default: 500) the period in milliseconds between
  • batchSize (optional, default: 100) the number of log messages to send in a single RPUSH command
  • purgeOnFailure (optional, default: true) whether to purge the enqueued log messages if an error occurs attempting to connect to redis, thus preventing the memory usage from becoming too high
  • alwaysBatch (optional, default: true) whether to wait for a full batch. if true, will only send once there are batchSize log messages enqueued
  • daemonThread (optional, default: true) whether to launch the appender thread as a daemon thread

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

log4j-redis-appender's People

Contributors

ryantenney avatar leandrosilva avatar pavlobaron avatar ahitrin avatar turtlebender avatar

Watchers

James Cloos avatar Takamichi Tatsumoto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.