Skip to content

Commit

Permalink
Merge pull request #46 from ing-bank/fix/logs
Browse files Browse the repository at this point in the history
fix logs parameters
  • Loading branch information
arempter committed May 26, 2020
2 parents 6c0db5a + e82b88a commit 8b07e15
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ class LoggerHandlerWithId {
def debug(message: String, args: Any*)(implicit id: RequestId, statusCode: StatusCode = StatusCodes.Continue): Unit = {
MDC.put(requestIdKey, id.value)
MDC.put(statusCodeKey, statusCode.value)
log.debug(message, args)
log.debug(message, args.asInstanceOf[Seq[AnyRef]]: _*)
MDC.remove(requestIdKey)
MDC.remove(statusCodeKey)
}

def info(message: String, args: Any*)(implicit id: RequestId, statusCode: StatusCode = StatusCodes.Continue): Unit = {
MDC.put(requestIdKey, id.value)
MDC.put(statusCodeKey, statusCode.value)
log.info(message, args)
log.info(message, args.asInstanceOf[Seq[AnyRef]]: _*)
MDC.remove(requestIdKey)
MDC.remove(statusCodeKey)
}

def warn(message: String, args: Any*)(implicit id: RequestId, statusCode: StatusCode = StatusCodes.Continue): Unit = {
MDC.put(requestIdKey, id.value)
MDC.put(statusCodeKey, statusCode.value)
log.warn(message, args)
log.warn(message, args.asInstanceOf[Seq[AnyRef]]: _*)
MDC.remove(requestIdKey)
MDC.remove(statusCodeKey)
}

def error(message: String, args: Any*)(implicit id: RequestId, statusCode: StatusCode = StatusCodes.Continue): Unit = {
MDC.put(requestIdKey, id.value)
MDC.put(statusCodeKey, statusCode.value)
log.error(message, args)
log.error(message, args.asInstanceOf[Seq[AnyRef]]: _*)
MDC.remove(requestIdKey)
MDC.remove(statusCodeKey)
}
Expand Down

0 comments on commit 8b07e15

Please sign in to comment.