Skip to content

Commit

Permalink
fixed log context missing strategy (#235)
Browse files Browse the repository at this point in the history
* fixed log context missing strat

* Update aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/strategy/LogErrorContextMissingStrategy.java

Co-authored-by: Anuraag Agrawal <[email protected]>

Co-authored-by: Anuraag Agrawal <[email protected]>
  • Loading branch information
willarmiros and anuraaga authored Nov 12, 2020
1 parent 188b07a commit 520766e
Showing 1 changed file with 2 additions and 2 deletions.
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));
}
}
}

0 comments on commit 520766e

Please sign in to comment.