Home

Awesome

Archived

This is no longer supported.


Log4J Appender for Amazon Kinesis

The Log4J Appender for Amazon Kinesis enables customers to publish logs from their Java applications into an Amazon Kinesis stream. We also provide a publisher application which uses the Log4J Appender for Amazon Kinesis to publish data from a file into an Amazon Kinesis stream.

Requirements

Overview

The Log4J Appender for Amazon Kinesis:

If a message is not successfully sent to Amazon Kinesis even after the retry attempts, then it is sent to the fallback handler (and no longer sent to Amazon Kinesis).

Note that the current implementation doesn't insert records in the same order as they are logged. One way to get ordering is by including a timestamp in the log entries and then sorting them at the consumer side of the Amazon Kinesis stream.

Configuration Options

ConfigurationDefaultDescription
log4j.appender.[APPENDER_NAME].streamNameStream name to which data is to be published
log4j.appender.[APPENDER_NAME].encodingUTF-8Encoding used to convert log message strings into bytes before sending
log4j.appender.[APPENDER_NAME].maxRetries3Maximum number of retries when calling Kinesis APIs to publish a log message.
log4j.appender.[APPENDER_NAME].threadCount20Number of parallel threads for publishing logs to configured Kinesis stream
log4j.appender.[APPENDER_NAME].bufferSize2000Maximum number of outstanding log messages to keep in memory
log4j.appender.[APPENDER_NAME].shutdownTimeout30Seconds to send buffered messages before application JVM quits normally
log4j.appender.[APPENDER_NAME].endpointkinesis.us-east-1.amazonaws.comAmazon Kinesis endpoint to make requests to, if configured this overrides default endpoint for the configured region
log4j.appender.[APPENDER_NAME].regionus-east-1Amazon Kinesis endpoint in this configured region will be used for making requests unless overridden by log4j.appender.[APPENDER_NAME].endpoint

Recommendations/Information

We recommend that customers:

Proxy Configuration

For customers who connect to the Internet through a proxy server, the Log4J Appender for Amazon Kinesis will pick up the Java proxy system properties and update the underlying ClientConfiguration instance.

Supported system properies are http.proxyHost, http.proxyPort, http.proxyUser, http.proxyPassword, and http.auth.ntlm.domain. For NTLM authentication on Windows, the COMPUTERNAME environment variable is used to set the proxy workstation.

Building from source

Publishing a File Using This Library

Related Resources