aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlad <vlad@driver.xyz>2017-03-13 23:38:32 -0700
committervlad <vlad@driver.xyz>2017-03-13 23:38:32 -0700
commitc71e402cee010d8cbc6e8119c8fb96367d085aa9 (patch)
tree6546f93f0490e25144de04a64ee61bf8c5e50a22
parenta999af6e8843785d00d4e636413f701308efbb5d (diff)
downloaddriver-core-c71e402cee010d8cbc6e8119c8fb96367d085aa9.tar.gz
driver-core-c71e402cee010d8cbc6e8119c8fb96367d085aa9.tar.bz2
driver-core-c71e402cee010d8cbc6e8119c8fb96367d085aa9.zip
Added writing tracking Id to MDC so it can be logged for all messages, removed some linkerd legacy and refined Revision equals
-rw-r--r--src/main/scala/xyz/driver/core/app.scala12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/scala/xyz/driver/core/app.scala b/src/main/scala/xyz/driver/core/app.scala
index 5a1b803..ceaf772 100644
--- a/src/main/scala/xyz/driver/core/app.scala
+++ b/src/main/scala/xyz/driver/core/app.scala
@@ -95,27 +95,23 @@ object app {
case is: IllegalStateException =>
ctx =>
- val trackingId = Option(MDC.get("trackingId")).getOrElse(rest.extractTrackingId(ctx.request))
- log.error(s"Request is not allowed to ${ctx.request.uri} ($trackingId)", is)
+ log.error(s"Request is not allowed to ${ctx.request.uri}", is)
complete(HttpResponse(BadRequest, entity = is.getMessage))(ctx)
case cm: ConcurrentModificationException =>
ctx =>
- val trackingId = Option(MDC.get("trackingId")).getOrElse(rest.extractTrackingId(ctx.request))
- log.error(s"Concurrent modification of the resource ${ctx.request.uri} ($trackingId)", cm)
+ log.error(s"Concurrent modification of the resource ${ctx.request.uri}", cm)
complete(
HttpResponse(Conflict, entity = "Resource was changed concurrently, try requesting a newer version"))(ctx)
case sex: SQLException =>
ctx =>
- val trackingId = Option(MDC.get("trackingId")).getOrElse(rest.extractTrackingId(ctx.request))
- log.error(s"Database exception for the resource ${ctx.request.uri} ($trackingId)", sex)
+ log.error(s"Database exception for the resource ${ctx.request.uri}", sex)
complete(HttpResponse(InternalServerError, entity = "Data access error"))(ctx)
case t: Throwable =>
ctx =>
- val trackingId = Option(MDC.get("trackingId")).getOrElse(rest.extractTrackingId(ctx.request))
- log.error(s"Request to ${ctx.request.uri} could not be handled normally ($trackingId)", t)
+ log.error(s"Request to ${ctx.request.uri} could not be handled normally", t)
complete(HttpResponse(InternalServerError, entity = t.getMessage))(ctx)
}