问题
I am running flow tests in Corda and want to set the logging level to debug
to see the SQL queries executed against the vault when I use vaultService.queryBy
.
How can I set the logging level in flow tests?
回答1:
You can override the flow tests' logger settings by passing -Dlog4j.configurationFile=/path/to/log4j2.xml
as a VM option.
For example, in the CorDapp Example (https://github.com/corda/samples), you could enable debug
-level logging in flows by:
- Updating
config/test/log4j2.xml
to change the logging level frominfo
todebug
- Modifying the
VM options
setting of theRun Flow Tests - Java
run configuration to-ea -javaagent:../lib/quasar.jar -Dlog4j.configurationFile=../config/test/log4j2.xml
来源:https://stackoverflow.com/questions/49262113/in-corda-how-can-i-set-the-logging-level-for-flow-tests