awslabs / amazon-kinesis-client-ruby

A Ruby interface for the Amazon Kinesis Client Library. Allows developers to easily create robust application to process Amazon Kinesis streams in Ruby.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set log level from command line

callumj opened this issue · comments

Is it possible to add documentation on how to set the log level of the Consumer? We'd like to log WARN and higher, we find that INFO is too verbose for us.

commented

agreed with @callumj, this is super verbose, especially the cloudwatch metric logs.

Thank you for leaving this suggestion, if other customers are having trouble with configuring logging, please +1 this issue to help us prioritize this work going forward.

In general the KCL uses ApacheCommons logging, which is documented on their site: https://commons.apache.org/proper/commons-logging/guide.html#Quick_Start

This thread has recommendations for how to configure it using KCL:
https://forums.aws.amazon.com/thread.jspa?threadID=192892

It is certainly possible. KCL uses apache commons logging library to log messages. Depending on the Log implementation you are using, one option is to provide appropriate logging configuration file when launching the KCL application to have your desired logging level.

For example, with Jdk14Logger (which might be default Log implementation if no other Log implementation is configured/found), I provided following commons-logging.properties file in my classpath to print only warning and error messages by default:
.level=WARNING

You can also provide the location of the properties file when launching the application:
java -Djava.util.logging.config.file=<location-of-properties-file> <MyKCLAppMainClass>