Skip to content
trunk
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

log4j-aws-appenders

Appenders for Log4J 1.x, Logback, and Log4J 2.x that write to various AWS destinations:

In addition, this library provides the following features:

  • JsonLayout, which lets you send data to an Elasticsearch/Kibana cluster without the need for parsing.
  • JMX integration, which allows the appenders to report operational data.
  • Substitions, which allow you to configure the appenders with information from the runtime environment, such as EC2 instance ID.

Usage

To use these appenders, include the framework-specific appenders JAR in your project, along with the JAR(s) specific to your logging framework and the relevant AWS JAR(s) as described below.

The appender JARs are published on Maven Central. You can find the latest version from the following links:

See the documentation for each appender for configuration. You can also look at the example projects.

Versions

I follow the standard MAJOR.MINOR.PATCH versioning scheme:

  • MAJOR is currently 2, representing the split from single-framework library to front- and back-end libraries supporting multiple frameworks.
  • MINOR is incremented for each change that adds signficant functionality or changes the behavior of existing functionality in non-backwards-compatible ways. The API does not break backwards compatibility for minor releases, so your configurations can remain the same.
  • PATCH is incremented for bugfixes or minor additions to existing features.

Dependencies

To avoid dependency hell, all dependencies are marked as "provided": you will need to ensure that your project includes necessary dependencies for your destination(s).

The minimum supported dependency versions are:

  • JDK: 1.7

  • Log4J 1.x: 1.2.16
    This is the first version that implements LoggingEvent.getTimeStamp(), which is needed to order messages when sending to AWS. It's been around since 2010, so if you haven't upgraded already you should.

  • Log4J 2.x: 2.10.0
    This is the first version that supports custom key/value pairs for JsonLayout. If that's not important to you, the library will work with version 2.8 (which introduced a breaking change in backwards compatibility).

  • Logback: 1.2.0
    This version is required to support JsonAccessLayout. If you don't use that, version 1.0.0 will work.

  • AWS SDK: 1.11.0
    The appenders will work with all releases in the 1.11.x sequence, but some features require later versions (eg, to access values from Parameter Store, you need 1.11.63). If you're using a version that has client builders, they will be used to create service clients; if not, the default client constructors are used. For more information, see the FAQ.

    Note: this library does not support the AWS SDK for Java 2.0. If you use that SDK, you will also need to include the JARs for the 1.x SDK to support this library.

I have made an intentional effort to limit dependencies to the bare minimum. This has in some cases meant that I write internal implementations for functions that are found in common libraries.

Contributions

At this time I am not accepting contributions. If you find a bug in the code, please submit an issue that explains the problem and includes the filename and line number (or better, a link to the source) where the error exists.

For more information

Release History

Frequently Asked Questions

Design Documentation and Implementation Notes

If you want to build it yourself, read this

About

Appenders for Log4J 1.2.x, Log4J 2.x, and Logback that write to AWS destinations.

Resources

License

Packages

No packages published
You can’t perform that action at this time.