Skip to content

Commit

Permalink
feat(logging): ops controller annotation + logstashEncoder dep (#1692)
Browse files Browse the repository at this point in the history
  • Loading branch information
asher authored Oct 17, 2017
1 parent 895f64c commit 79f1f73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions orca-web/orca-web.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ dependencies {
compile spinnaker.dependency('korkExceptions')
compile spinnaker.dependency("korkStackdriver")
compile spinnaker.dependency("korkWeb")
compile spinnaker.dependency("logstashEncoder")

spinnaker.group('test')
testCompile project(":orca-test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RestController
import static net.logstash.logback.argument.StructuredArguments.value

@RestController
@Slf4j
Expand Down Expand Up @@ -82,7 +83,7 @@ class OperationsController {
pipeline.trigger = trigger

def json = objectMapper.writeValueAsString(pipeline)
log.info('received pipeline {}:{}', pipeline.id, json)
log.info('received pipeline {}:{}', value("pipelineId", pipeline.id), json)

if (pipeline.disabled) {
throw new InvalidRequestException("Pipeline is disabled and cannot be started.")
Expand All @@ -94,7 +95,7 @@ class OperationsController {
}

if (plan) {
log.info('not starting pipeline (plan: true): {}', pipeline.id)
log.info('not starting pipeline (plan: true): {}', value("pipelineId", pipeline.id))
if (pipeline.errors != null) {
throw new ValidationException("Pipeline template is invalid", pipeline.errors as List<Map<String, Object>>)
}
Expand Down

0 comments on commit 79f1f73

Please sign in to comment.