Skip to content
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

fixed log context missing strategy #235

Merged
merged 3 commits into from
Nov 12, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public class LogErrorContextMissingStrategy implements ContextMissingStrategy {
private static final Log logger = LogFactory.getLog(LogErrorContextMissingStrategy .class);

/**
* Logs {@code message} on the {#code error} level.
* Logs {@code message} on the {@code error} level, and a stacktrace at {@code debug} level.
* @param message the message to log
* @param exceptionClass the type of exception suppressed in favor of logging {@code message}
*/
@Override
public void contextMissing(String message, Class<? extends RuntimeException> exceptionClass) {
logger.error("Suppressing AWS X-Ray context missing exception (" + exceptionClass.getSimpleName() + "): " + message);
if (logger.isDebugEnabled()) {
logger.debug(new RuntimeException(message));
logger.debug("Attempted to find context at:", new RuntimeException(message));
}
}
}