Can I finely control logging by Corda nodes

偶尔善良 提交于 2020-01-15 09:27:04

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!