Colin
Colin

Reputation: 3762

Can I finely control logging by Corda nodes

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?

Upvotes: 1

Views: 463

Answers (3)

Joel
Joel

Reputation: 23210

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.

Upvotes: 1

JohnZ
JohnZ

Reputation: 144

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

Upvotes: 1

Cais Manai
Cais Manai

Reputation: 966

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)

Upvotes: 2

Related Questions