Generic log4j appender that uses Scribe for sending log messages
Java
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
interface
lib
src/java/org/apache/log4j/scribe
.gitignore
LICENSE
README
scribelog4j.jar

README

Scribe log4j Appender
====================================
Much of this work is based on Alex Loddengaard (http://github.com/alexlod/scribe-log4j-appender).

I cleaned up his code to work in non-hadoop environments. I added support to reconnect if it loses a connection or if scribe goes away.

You will need the following libraries for your project, which are in lib/ folder for convenience:

./lib/libthrift-r808609.jar
./lib/log4j-1.2.15.jar
./lib/slf4j-api-1.5.8.jar
./lib/slf4j-log4j12-1.5.8.jar

Example to enable in log4j:

# Add scribe to end of rootLogger:

log4j.rootLogger=DEBUG,stdout,scribe

#
# Add this to your log4j.properties
#
# You can adjust the scribe_host and scribe_port you want messages sent to by setting
# scribe_host and scribe_port
#
# You can also set the hostname if you do not want to rely on Java picking the correct hostname

log4j.appender.scribe=org.apache.log4j.scribe.ScribeAppender
log4j.appender.scribe.scribe_category=MyScribeCategoryName
log4j.appender.scribe.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.scribe.layout=org.apache.log4j.PatternLayout
log4j.appender.scribe.layout.ConversionPattern=%5p [%t] %d{ISO8601} %F (line %L) %m%n