diff --git a/build.gradle b/build.gradle index e163a2f0f..d1f83fd43 100644 --- a/build.gradle +++ b/build.gradle @@ -36,7 +36,7 @@ allprojects { group = "com.netflix.spinnaker.echo" ext { - spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.91.0' + spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.99.0' } def checkLocalVersions = [spinnakerDependenciesVersion: spinnakerDependenciesVersion] diff --git a/echo-core/echo-core.gradle b/echo-core/echo-core.gradle index 1a6b5cf9c..2faa82784 100644 --- a/echo-core/echo-core.gradle +++ b/echo-core/echo-core.gradle @@ -19,6 +19,7 @@ dependencies { compile project(":echo-model") compile spinnaker.dependency('rxJava') + compile spinnaker.dependency('logstashEncoder') testCompile spinnaker.dependency('spockSpring') testCompile spinnaker.dependency('springTest') } diff --git a/echo-core/src/main/groovy/com/netflix/spinnaker/echo/events/EventPropagator.groovy b/echo-core/src/main/groovy/com/netflix/spinnaker/echo/events/EventPropagator.groovy index d0cc6ef22..910d5b260 100644 --- a/echo-core/src/main/groovy/com/netflix/spinnaker/echo/events/EventPropagator.groovy +++ b/echo-core/src/main/groovy/com/netflix/spinnaker/echo/events/EventPropagator.groovy @@ -22,7 +22,6 @@ import rx.Observable import rx.Scheduler import rx.functions.Action0 import rx.schedulers.Schedulers - /** * responsible for sending events to classes that implement an EchoEventListener */ diff --git a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/EmailNotificationAgent.groovy b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/EmailNotificationAgent.groovy index f9b2a0836..708017049 100644 --- a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/EmailNotificationAgent.groovy +++ b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/EmailNotificationAgent.groovy @@ -26,6 +26,7 @@ import org.springframework.stereotype.Service import org.springframework.ui.velocity.VelocityEngineUtils import static groovy.json.JsonOutput.prettyPrint import static groovy.json.JsonOutput.toJson +import static net.logstash.logback.argument.StructuredArguments.* @Slf4j @ConditionalOnProperty('mail.enabled') @@ -70,7 +71,7 @@ class EmailNotificationAgent extends AbstractEventNotificationAgent { status == 'complete' ? 'completed successfully' : status }""" - log.info("Send Email: ${preference.address} for ${application} ${config.type} ${status} ${event.content?.execution?.id}") + log.info('Sending email {} for {} {} {} {}', kv('address', preference.address), kv('application', application), kv('type', config.type), kv('status', status), kv('executionId', event.content?.execution?.id)) sendMessage( preference.address ? [preference.address] as String[] : null, diff --git a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/HipchatNotificationAgent.groovy b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/HipchatNotificationAgent.groovy index ba335b388..f5b838aaf 100644 --- a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/HipchatNotificationAgent.groovy +++ b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/HipchatNotificationAgent.groovy @@ -26,6 +26,8 @@ import org.springframework.beans.factory.annotation.Value import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.stereotype.Service +import static net.logstash.logback.argument.StructuredArguments.kv + @Slf4j @ConditionalOnProperty('hipchat.enabled') @Service @@ -65,8 +67,8 @@ class HipchatNotificationAgent extends AbstractEventNotificationAgent { } } - log.info("Send Hipchat message to" + - " ${preference.address} for ${application} ${config.type} ${status} ${event.content?.execution?.id}") + log.info('Sending Hipchat message {} for {} {} {} {}', kv('address', preference.address), kv('application', application), kv('type', config.type), kv('status', status), kv('executionId', event.content?.execution?.id)) + String message = '' diff --git a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/SlackNotificationAgent.groovy b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/SlackNotificationAgent.groovy index fafcf1e43..e889dc2cc 100644 --- a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/SlackNotificationAgent.groovy +++ b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/notification/SlackNotificationAgent.groovy @@ -24,6 +24,8 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Value import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.stereotype.Service +import static net.logstash.logback.argument.StructuredArguments.* + @Slf4j @ConditionalOnProperty('slack.enabled') @@ -63,8 +65,7 @@ class SlackNotificationAgent extends AbstractEventNotificationAgent { } } - log.info("Send Slack message to" + - " ${preference.address} for ${application} ${config.type} ${status} ${event.content?.execution?.id}") + log.info('Sending Slack message {} for {} {} {} {}', kv('address', preference.address), kv('application', application), kv('type', config.type), kv('status', status), kv('executionId', event.content?.execution?.id)) String body = '' diff --git a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/pagerduty/PagerDutyNotificationService.groovy b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/pagerduty/PagerDutyNotificationService.groovy index ae2729ad9..63294b12b 100644 --- a/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/pagerduty/PagerDutyNotificationService.groovy +++ b/echo-notifications/src/main/groovy/com/netflix/spinnaker/echo/pagerduty/PagerDutyNotificationService.groovy @@ -26,6 +26,8 @@ import org.springframework.beans.factory.annotation.Value import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.stereotype.Component +import static net.logstash.logback.argument.StructuredArguments.kv + @Slf4j @Component @ConditionalOnProperty('pagerDuty.enabled') @@ -58,7 +60,7 @@ class PagerDutyNotificationService implements NotificationService { ) ) - log.info("Sent page (serviceKey: ${it}, message: '${notification.additionalContext.message}')") + log.info('Sent page {} {}', kv('serviceKey', it), kv('message', notification.additionalContext.message)) } } } diff --git a/echo-scheduler/src/main/groovy/com/netflix/spinnaker/echo/scheduler/actions/pipeline/impl/MissedPipelineTriggerCompensationJob.groovy b/echo-scheduler/src/main/groovy/com/netflix/spinnaker/echo/scheduler/actions/pipeline/impl/MissedPipelineTriggerCompensationJob.groovy index e47c17483..574a2f5fb 100644 --- a/echo-scheduler/src/main/groovy/com/netflix/spinnaker/echo/scheduler/actions/pipeline/impl/MissedPipelineTriggerCompensationJob.groovy +++ b/echo-scheduler/src/main/groovy/com/netflix/spinnaker/echo/scheduler/actions/pipeline/impl/MissedPipelineTriggerCompensationJob.groovy @@ -41,6 +41,8 @@ import java.time.ZoneId import java.time.temporal.ChronoUnit import java.util.concurrent.TimeUnit +import static net.logstash.logback.argument.StructuredArguments.* + /** * Finds and executes all pipeline triggers that should have run in the last configured time window during startup. * This job will wait until the {@link com.netflix.spinnaker.echo.pipelinetriggers.PipelineCache} has run prior to @@ -112,7 +114,7 @@ class MissedPipelineTriggerCompensationJob implements ApplicationListener pipelines) { @@ -149,7 +151,7 @@ class MissedPipelineTriggerCompensationJob implements ApplicationListener