File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ implicit case object CanLogCorrelationId extends CanLog[CorrelationId] {
9292implicit val correlationId = CorrelationId (" ID" )
9393
9494val logger = Logger .takingImplicit[CorrelationId ](" test" )
95- logger.info(" Test" ) // logs "ID Test"
95+ logger.info(" Test" ) // takes implicit correlationId and logs "ID Test"
9696```
9797
9898It's possible to use ` MDC ` through ` CanLog ` without any troubles with execution context.
@@ -113,7 +113,13 @@ implicit case object CanLogCorrelationId extends CanLog[CorrelationId] {
113113implicit val correlationId = CorrelationId (" ID" )
114114
115115val logger = Logger .takingImplicit[CorrelationId ](" test" )
116- Future (logger.info(" Test" ))
116+
117+ def serviceMethod (implicit correlationId : CorrelationId ): Future [Result ] = {
118+ dbCall.map { value =>
119+ logger.trace(s " Received value $value from db " ) // takes implicit correlationId
120+ toResult(value)
121+ }
122+ }
117123```
118124
119125### What's new?
You can’t perform that action at this time.
0 commit comments