Created
February 21, 2017 05:42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final AggregatedLogData logData = new AggregatedLogData(); | |
logData.setLevel(AggregatedLogLevel.FULL); | |
boolean error = false; | |
try { | |
// .. execute code here | |
} catch (Exception e) { | |
logData.collectException("Failed to process rules", e); | |
error = true; | |
} finally { | |
if (error) { | |
logData.setLevel(AggregatedLogLevel.EXHAUSTIVE); // print all on error | |
log.error(logData.toJsonString()); | |
} else { | |
log.info(logData.toJsonString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment