public class CloudWatchAppender extends AbstractAppender<CloudWatchWriterConfig,CloudWatchAppenderStatistics,CloudWatchAppenderStatisticsMXBean>
appenderStats, batchDelay, clientEndpoint, clientFactory, discardAction, discardThreshold, lastRotationCount, lastRotationTimestamp, rotationInterval, rotationMode, sequence, threadFactory, writer, writerFactory| Constructor and Description |
|---|
CloudWatchAppender()
Base constructor: assigns default values to configuration properties.
|
| Modifier and Type | Method and Description |
|---|---|
protected CloudWatchWriterConfig |
generateWriterConfig()
Called just before a writer is created, so that the subclass can
perform substitutions on the configuration.
|
String |
getLogGroup()
Returns the log group name; see
setLogGroup(java.lang.String). |
String |
getLogStream()
Returns the log stream name; see
setLogStream(java.lang.String). |
protected boolean |
isMessageTooLarge(LogMessage message)
Called
AbstractAppender.append(org.apache.log4j.spi.LoggingEvent) to ensure that we don't have a single message
that violates AWS batching rules. |
void |
rotate()
Rotates the log stream: flushes all outstanding messages to the current
stream, and opens a new stream.
|
void |
setLogGroup(String value)
Sets the CloudWatch Log Group associated with this appender.
|
void |
setLogStream(String value)
Sets the CloudWatch Log Stream associated with this appender.
|
append, close, getAppenderStatistics, getBatchDelay, getClientEndpoint, getClientFactory, getDiscardAction, getDiscardThreshold, getRotationInterval, getRotationMode, getSequence, registerStatisticsBean, requiresLayout, setBatchDelay, setClientEndpoint, setClientFactory, setDiscardAction, setDiscardThreshold, setRotationInterval, setRotationMode, setSequence, unregisterStatisticsBeanpublic CloudWatchAppender()
public void setLogGroup(String value)
You typically assign a single log group to an application, and then use multiple log streams for instances of that application.
There is no default value. If you do not configure the log group, the appender will be disabled and will report its misconfiguration.
public String getLogGroup()
setLogGroup(java.lang.String). Primarily used
for testing.public void setLogStream(String value)
You typically create a separate log stream for each instance of the application.
Default value is {startTimestamp}, the JVM startup timestamp.
public String getLogStream()
setLogStream(java.lang.String). Primarily used
for testing.public void rotate()
protected CloudWatchWriterConfig generateWriterConfig()
AbstractAppenderprotected boolean isMessageTooLarge(LogMessage message)
AbstractAppenderAbstractAppender.append(org.apache.log4j.spi.LoggingEvent) to ensure that we don't have a single message
that violates AWS batching rules.Copyright © 2018. All rights reserved.