aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlad <vlad@drivergrp.com>2016-09-23 13:35:43 -0700
committervlad <vlad@drivergrp.com>2016-09-23 13:35:43 -0700
commitfbe3ac7a30f6d045673522f3a7290356f182a83b (patch)
tree78dbc901388841e9ad51f1b65c483e95839e0a97
parent40ccc4f46ad521438ad6a208f2002ed252ecd727 (diff)
downloaddriver-core-fbe3ac7a30f6d045673522f3a7290356f182a83b.tar.gz
driver-core-fbe3ac7a30f6d045673522f3a7290356f182a83b.tar.bz2
driver-core-fbe3ac7a30f6d045673522f3a7290356f182a83b.zip
Rest service debug infov0.8.5
-rw-r--r--src/main/scala/com/drivergrp/core/app.scala6
-rw-r--r--src/main/scala/com/drivergrp/core/rest.scala10
2 files changed, 10 insertions, 6 deletions
diff --git a/src/main/scala/com/drivergrp/core/app.scala b/src/main/scala/com/drivergrp/core/app.scala
index 8018ab4..53f30ba 100644
--- a/src/main/scala/com/drivergrp/core/app.scala
+++ b/src/main/scala/com/drivergrp/core/app.scala
@@ -68,6 +68,8 @@ object app {
// TODO: extract `requestUuid` from request or thread, provided by linkerd/zipkin
def requestUuid = java.util.UUID.randomUUID.toString
+ is.printStackTrace()
+
log.debug(s"Request is not allowed to $uri ($requestUuid)", is)
complete(
HttpResponse(BadRequest,
@@ -79,6 +81,8 @@ object app {
// TODO: extract `requestUuid` from request or thread, provided by linkerd/zipkin
def requestUuid = java.util.UUID.randomUUID.toString
+ cm.printStackTrace()
+
log.debug(s"Concurrent modification of the resource $uri ($requestUuid)", cm)
complete(
HttpResponse(Conflict,
@@ -90,6 +94,8 @@ object app {
// TODO: extract `requestUuid` from request or thread, provided by linkerd/zipkin
def requestUuid = java.util.UUID.randomUUID.toString
+ t.printStackTrace()
+
log.error(s"Request to $uri could not be handled normally ($requestUuid)", t)
complete(
HttpResponse(InternalServerError,
diff --git a/src/main/scala/com/drivergrp/core/rest.scala b/src/main/scala/com/drivergrp/core/rest.scala
index 753fda6..44c7211 100644
--- a/src/main/scala/com/drivergrp/core/rest.scala
+++ b/src/main/scala/com/drivergrp/core/rest.scala
@@ -59,27 +59,25 @@ object rest {
log.audit(s"Sending to ${request.uri} request $request")
- Console.print("(((((((((((")
-
val responseEntity = Http()(actorSystem).singleRequest(request)(materializer) map { response =>
if(response.status.isFailure() && response.status != StatusCodes.NotFound) {
- Console.print(")))))))))")
+ log.audit(")))))))))")
throw new Exception("Http status is failure " + response.status)
} else {
- Console.print("OOOOOOOOOOOO")
+ log.audit("OOOOOOOOOOOO")
Unmarshal(response.entity.transformDataBytes(decryptionFlow))
}
}
responseEntity.onComplete {
case Success(r) =>
- Console.print("1111111111111")
+ log.audit("1111111111111")
val responseTime = time.currentTime()
log.audit(s"Response from ${request.uri} to request $requestStub is successful")
stats.recordStats(Seq("request", request.uri.toString, "success"), TimeRange(requestTime, responseTime), 1)
case Failure(t: Throwable) =>
- Console.print("2222222222222")
+ log.audit("2222222222222")
val responseTime = time.currentTime()
log.audit(s"Failed to receive response from ${request.uri} to request $requestStub")
log.error(s"Failed to receive response from ${request.uri} to request $requestStub", t)