is there a way to log a property from MDC as Integer? I have this pattern in my logback.xml
,
<pattern>
{
"level": "%level",
"maz": {
"tenant": "%mdc{tenant}",
"login": "%mdc{login}",
"process": "backend"
},
"http": {
"host": "%mdc{host}",
"provider": "%mdc{provider}",
"method": "%mdc{method}",
"request": "%mdc{request}",
"query": "%mdc{query}",
"size_o": "%mdc{size}",
"status": "%mdc{status}",
"duration_ms": "%mdc{duration}"
},
"message": "%message"
}
</pattern>
and I want to print the duration as Integer not string, if not, is there a way to read a java variable in logback.xml
? or is there any suggestion to log this variable as integer?