问题
How can I control logging from corda nodes better? Is the log4j2.xml file the only place? Can I, for instance, only turn off the I 15:37:04 89 NodeVaultService._queryBy - Vault Query for contract type: etc
messages?
回答1:
You cannot turn off specific messages, but your node's logging configuration file can specify the level each class should print messages at. For example, you could specify that the net.corda.node.services.vault.NodeVaultService
class should only print messages that are WARN
or above, which would filter out the message above (as well as any other INFO
-level messages from the NodeVaultService
.
You can find instructions on how to perform this filtering here: How to stop node from logging node.conf during startup.
回答2:
In addition to Joel's answer.
If you're launching using runnodes, you can pass logging level parameters through Gradle using "logging-level=DEBUG".
As well as 'DEBUG', you can pass in ERROR, WARN, INFO, DEBUG, TRACE (ascending order of verbosity)
回答3:
So the runnodes command is ./runnodes --logging-level=DEBUG
BTW, if starting the node with corda.jar, we can set the logging level as follows - java -jar corda.jar --logging-level=DEBUG
\Sean
来源:https://stackoverflow.com/questions/50295927/can-i-finely-control-logging-by-corda-nodes