Amazon CloudWatch Logback Appender

Send logs to Amazon CloudWatch Logs using an asynchronous bounded FIFO log queue for CloudWatch communication. Data encoding and submission is managed using a dedicated thread.

License

License

Categories

Categories

Logback Application Layer Libs Logging
GroupId

GroupId

com.lightstreamer
ArtifactId

ArtifactId

cloudwatch-logback-appender
Last Version

Last Version

0.11.0
Release Date

Release Date

Type

Type

jar
Description

Description

Amazon CloudWatch Logback Appender
Send logs to Amazon CloudWatch Logs using an asynchronous bounded FIFO log queue for CloudWatch communication. Data encoding and submission is managed using a dedicated thread.
Project URL

Project URL

https://github.com/Lightstreamer/cloudwatch-logback-appender
Source Code Management

Source Code Management

https://github.com/Lightstreamer/cloudwatch-logback-appender

Download cloudwatch-logback-appender

How to add to project

<!-- https://jarcasting.com/artifacts/com.lightstreamer/cloudwatch-logback-appender/ -->
<dependency>
    <groupId>com.lightstreamer</groupId>
    <artifactId>cloudwatch-logback-appender</artifactId>
    <version>0.11.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.lightstreamer/cloudwatch-logback-appender/
implementation 'com.lightstreamer:cloudwatch-logback-appender:0.11.0'
// https://jarcasting.com/artifacts/com.lightstreamer/cloudwatch-logback-appender/
implementation ("com.lightstreamer:cloudwatch-logback-appender:0.11.0")
'com.lightstreamer:cloudwatch-logback-appender:jar:0.11.0'
<dependency org="com.lightstreamer" name="cloudwatch-logback-appender" rev="0.11.0">
  <artifact name="cloudwatch-logback-appender" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.lightstreamer', module='cloudwatch-logback-appender', version='0.11.0')
)
libraryDependencies += "com.lightstreamer" % "cloudwatch-logback-appender" % "0.11.0"
[com.lightstreamer/cloudwatch-logback-appender "0.11.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.fasterxml.jackson.datatype : jackson-datatype-joda jar 2.8.1
com.amazonaws : aws-java-sdk-logs jar 1.11.155

provided (1)

Group / Artifact Type Version
ch.qos.logback : logback-classic jar 1.1.7

Project Modules

There are no modules declared in this project.

Logback appender for AWS CloudWatch

CloudWatch Logback Appender

Send logs to Amazon CloudWatch Logs.

The appender, internally, uses an asynchronous bounded FIFO log queue for CloudWatch communication. Data encoding and submission is managed using a dedicated thread. After data submission, if the log queue contains at least minLogSize, then new data is submitted immediately, else it waits for maxLogSize data in FIFO or for logPollTimeMillis timeout.

Requirements:

  • Amazon IAM user with 'CloudWatchLogsFullAccess' (arn:aws:iam::aws:policy/CloudWatchLogsFullAccess) policy

or

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "logs:PutLogEvents"
    ],
      "Resource": [
        "arn:aws:logs:eu-west-1:*:test-log-group:log-stream:*"
    ]
  }
 ]
}

Usage:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

	<appender name="AWS_LOGS" class="com.lightstreamer.cloudwatch.logback.appender.AwsLogsJsonAppender">
		<awsRegionName>region</awsRegionName>
		<logGroupName>test-log-group</logGroupName>
	</appender>

	<root level="DEBUG">
		<appender-ref ref="CONSOLE" />
		<appender-ref ref="AWS_LOGS" />
	</root>
	
</configuration>

Properties:

Property Required Description
awsRegionName no CloudWatch region name.
createLogGroup no Create log group if missing. Default: false
logGroupName no CloudWatch log group name. Default: test-log-group
logStreamName no CloudWatch stream name. Default: hostName+timeStamp
logPollTimeMillis no Log polling time in milliseconds. Default: 3000
minLogSize no Min event for wait polling. Default: 128
maxLogSize no Max events in putLogEvents. Default: 1024
com.lightstreamer

Lightstreamer

The Lightstreamer company

Versions

Version
0.11.0
0.10.1