logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volkan Yazıcı <volkan.yaz...@gmail.com>
Subject Non-String values in Thread Context Map (MDC)
Date Sat, 02 Nov 2019 20:11:49 GMT
Hello,

LogEvent#getContextData() returns a ReadOnlyStringMap such that the
provided get() and forEach() allow non-String values in the entries. That
said, ReadOnlyStringMap#toMap() returns a Map<String, String>. Further,
both ThreadContext.put() and ThreadContext.putAll() only allow String
values. I am confused by this inconsistency. Is there a way to provide an
MDC entry where the value is of a non-String type?

Best.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message