This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
ext { | |
logbackVersion = '1.1.6' | |
slf4jApiVersion = '1.7.15' | |
logStashLogbackEncoderVersion = '4.7' | |
} | |
... | |
compile("ch.qos.logback:logback-classic:$logbackVersion") | |
compile("ch.qos.logback:logback-core:$logbackVersion") | |
compile("ch.qos.logback:logback-access:$logbackVersion") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
ext { | |
logbackVersion = '1.1.6' | |
slf4jApiVersion = '1.7.15' | |
logStashLogbackEncoderVersion = '4.7' | |
} | |
compile("ch.qos.logback:logback-classic:$logbackVersion") | |
compile("ch.qos.logback:logback-core:$logbackVersion") | |
compile("ch.qos.logback:logback-access:$logbackVersion") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@timestamp":"2016-07-21T14:00:10.389+1000", | |
"@version":1, | |
"message":"Started CloudwatchLoggingApplication in 1.97 seconds (JVM running for 3.463)", | |
"logger_name":"c.m.l.CloudwatchLoggingApplication", | |
"thread_name":"main", | |
"level":"INFO", | |
"level_value":20000 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ch.qos.logback.core.ConsoleAppender | |
import codes.monkey.logging.BeanStalkPropertyDefiner | |
import codes.monkey.logging.LoggingTagsPropertyDefiner | |
import net.logstash.logback.appender.LoggingEventAsyncDisruptorAppender | |
import net.logstash.logback.stacktrace.ShortenedThrowableConverter | |
import codes.monkey.logging.TimestampFormatPropertyDefiner.CloudwatchLogstashEncoder | |
import groovy.json.JsonOutput | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@timestamp":"2016-07-27T10:15:02.606+1000", | |
"@version":1, | |
"@message":"0:0:0:0:0:0:0:1 - - [2016-07-27T10:15:02.606+10:00] \"GET /favicon.ico HTTP/1.1\" 200 946", | |
"fields_method":"GET", | |
"fields_protocol":"HTTP/1.1", | |
"fields_status_code":200, | |
"fields_requested_url":"GET /favicon.ico HTTP/1.1", | |
"fields_requested_uri":"/favicon.ico", | |
"fields_remote_host":"0:0:0:0:0:0:0:1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
class CloudwatchLoggingApplication { | |
@Bean | |
EmbeddedServletContainerFactory servletContainer(TomcatContextCustomizer customizer) { | |
def factory = new TomcatEmbeddedServletContainerFactory() | |
factory.setTomcatContextCustomizers([customizer]) | |
factory | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<define name="app_name" class="codes.monkey.logging.LoggingTagsPropertyDefiner"> | |
<property>app.name</property> | |
</define> | |
<define name="app_version" class="codes.monkey.logging.LoggingTagsPropertyDefiner"> | |
<property>app.version</property> | |
</define> | |
<define name="eb_hostname" class="codes.monkey.logging.BeanStalkPropertyDefiner"> | |
<field>hostname</field> | |
</define> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mappings: | |
CWLogs: | |
WebRequestLogGroup: | |
TimestampFormat: "%Y-%m-%dT%H:%M:%S.%f%z" | |
Outputs: | |
WebRequestCWLogGroup: | |
Description: "The name of the Cloudwatch Logs Log Group created for this environments web server access logs. You can specify this by setting the value for the environment variable: WebRequestCWLogGroup. Please note: if you update this value, then you will need to go and clear out the old cloudwatch logs group and delete it through Cloudwatch Logs." | |
Value: { "Ref" : "AWSEBCloudWatchLogsAppLogGroup"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:PutLogEvents", | |
"logs:DescribeLogStreams", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appender('perf-summary', LogstashAsyncCoalescingStatisticsAppender) { | |
timeSlice = 30000 | |
queueSize = 30000 | |
createRollupStatistics = false | |
appender(LoggingEventAsyncDisruptorAppender) { | |
appender(ConsoleAppender) { | |
encoder(CloudwatchLogstashEncoder) { | |
customFields = loggingMarkers | |
shortenedLoggerNameLength = 36 | |
} |
OlderNewer