ReXSL

13-Nov-2012 0.4.1

Log4j Cloud Appender

Read CloudAppender javadoc.

Configure it in your log4j.properties like this (just an example, which uses loggly.com HTTP log consuming interface):

log4j.rootLogger=WARN, LOGGLY
log4j.appender.LOGGLY=com.rexsl.log.CloudAppender
log4j.appender.LOGGLY.feeder=com.rexsl.log.HttpFeeder
log4j.appender.LOGGLY.feeder.url=https://logs.loggly.com/inputs/0604e96...
log4j.appender.LOGGLY.feeder.split=true
log4j.appender.LOGGLY.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGGLY.layout.ConversionPattern=[%5p] %t %c: %m%n

You can extend it with your own feeding mechanisms. Just implement the Feeder interface and add an instance of the class to the appender.

You need this dependency in classpath:

<dependency>
  <groupId>com.rexsl</groupId>
  <artifactId>rexsl-core</artifactId>
  <version>0.4.1</version>
</dependency>

Copyright © 2011-2012 ReXSL.com, All Rights Reserved. Privacy Policy.