@@ -7,6 +7,8 @@ import com.ing.wbaa.rokku.proxy.metrics.MetricsFactory._
7
7
import com .typesafe .scalalogging .Logger
8
8
import org .slf4j .{ LoggerFactory , MDC }
9
9
10
+ import scala .collection .mutable
11
+
10
12
class LoggerHandlerWithId {
11
13
12
14
@ transient
@@ -19,23 +21,25 @@ class LoggerHandlerWithId {
19
21
def debug (message : String , args : Any * )(implicit id : RequestId ): Unit = {
20
22
MDC .put(requestIdKey, id.value)
21
23
MDC .put(statusCodeKey, " -" )
22
- log.debug(message, args)
24
+ log.debug(message, args. asInstanceOf [mutable. WrappedArray [ AnyRef ]] : _* )
23
25
MDC .remove(requestIdKey)
24
26
MDC .remove(statusCodeKey)
25
27
}
26
28
29
+ def a (x : Any * ) = println(x.length)
30
+
27
31
def info (message : String , args : Any * )(implicit id : RequestId ): Unit = {
28
32
MDC .put(requestIdKey, id.value)
29
33
MDC .put(statusCodeKey, " -" )
30
- log.info(message, args)
34
+ log.info(message, args. asInstanceOf [mutable. WrappedArray [ AnyRef ]] : _* )
31
35
MDC .remove(requestIdKey)
32
36
MDC .remove(statusCodeKey)
33
37
}
34
38
35
39
def warn (message : String , args : Any * )(implicit id : RequestId , statusCode : StatusCode = StatusCodes .Continue ): Unit = {
36
40
MDC .put(requestIdKey, id.value)
37
41
MDC .put(statusCodeKey, statusCode.value)
38
- log.warn(message, args)
42
+ log.warn(message, args. asInstanceOf [mutable. WrappedArray [ AnyRef ]] : _* )
39
43
MDC .remove(requestIdKey)
40
44
MDC .remove(statusCodeKey)
41
45
}
@@ -44,7 +48,7 @@ class LoggerHandlerWithId {
44
48
MDC .put(requestIdKey, id.value)
45
49
MDC .put(statusCodeKey, statusCode.value)
46
50
countLogErrors(MetricsFactory .ERROR_REPORTED_TOTAL )
47
- log.error(message, args)
51
+ log.error(message, args. asInstanceOf [mutable. WrappedArray [ AnyRef ]] : _* )
48
52
MDC .remove(requestIdKey)
49
53
MDC .remove(statusCodeKey)
50
54
}
0 commit comments