You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
It looks like handling a Long in GelfUtil.addMdcProfiling isn't done properly. There's a couple of ways to fix it. I'd add an else to the requestStartMs instanceof Long (and removing timestamp == -1 is possible too).
Resulting in something like this:
if (instanceof Long) {...} else if (instanceof String) {...} else {return;}
The text was updated successfully, but these errors were encountered:
If requestStartMs is a Long, which it looks like addMdcProfiling is supposed to support, then the value is ignored and the duration isn't added to the message.
requestStartMs must be in any case numeric and can be stored within the MDC either as long (Long) or as String. The latter is used with slf4j's MDC. The code is a leftover from direct MDC usage. LogEvent returns directly a String.
You're totally right, the bug is so obvious that I haven't seen it for years now. Do you want to send in a PR or should I take care of it?
It looks like handling a Long in GelfUtil.addMdcProfiling isn't done properly. There's a couple of ways to fix it. I'd add an else to the requestStartMs instanceof Long (and removing timestamp == -1 is possible too).
Resulting in something like this:
if (instanceof Long) {...} else if (instanceof String) {...} else {return;}
The text was updated successfully, but these errors were encountered: