-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLF4J_MANUALLY_PROVIDED_MESSAGE should be ignored for TRACE and DEBUG #31
Comments
Hi @melloware, thanks for your contribution and sorry for my delay. Could you explain why you don't log stacktrace of I will consider how to support this case, but I think, switching by log level isn't cool because logging policy (when/how to use each level) depends on project. Currently I think it is better to switch by existence of // invalid: duplicated message will be logged.
LOG.debug("Reporting BusinessException for method {}: {}", new Object[] { methodName, localizedMessage, e });
// valid: message will be logged only once.
LOG.debug("Reporting BusinessException for method {}: {}", new Object[] { methodName, localizedMessage }); |
My thought was this was an Exception that the user is going to have displayed as some sort of ValidationException or BusinessException. I want to log a single line in the log file just to let the log know this error is going back to the user but since its not a "true" exception I don't want the whole stack trace. Because then the logs get filled with stacktraces for basically validation errors. That was my only thought. |
OK, I got it. Then it is better to switch by existence of |
@melloware Note that I tested |
In certain scenarios we want to log a DEBUG of just the localized message and not the full stack trace...
We are getting the SLF4J_MANUALLY_PROVIDED_MESSAGE error. Maybe that should only be for INFO and higher or WARN and higher?
The text was updated successfully, but these errors were encountered: