Created
February 9, 2021 19:13
-
-
Save davidawad/3cf1cd8608761179ff1af643eaa7922b to your computer and use it in GitHub Desktop.
example usage of custom logging in corda
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
Logger logger = LoggerFactory.getLogger("net.corda"); // note this logger's name is specified in the xml config | |
Party me = getOurIdentity(); | |
// we have an opportunity to log out the contents of the flow arguments. | |
ThreadContext.put("initiator", me.getName().toString()); | |
ThreadContext.put("target", target.getName().toString()); | |
// publish to the log with the additional context | |
logger.info("Initializing the transaction."); | |
// flush the threadContext of these additional properties | |
ThreadContext.removeAll(Arrays.asList("initiator", "target")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment