在Corda中,如何设置流量测试的日志记录级别? [英] In Corda, how can I set the logging level for flow tests?
问题描述
我正在Corda中运行流测试,并想将日志记录级别设置为 debug
,以查看使用时针对库执行的SQL查询。 vaultService.queryBy
。
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?
推荐答案
您可以通过传递 -Dlog4j.configurationFile = / path / to / log4j2.xml
来覆盖流测试的记录器设置。一个VM选项。
You can override the flow tests' logger settings by passing -Dlog4j.configurationFile=/path/to/log4j2.xml
as a VM option.
例如,在CorDapp示例中( https://github.com/corda/samples ),您可以通过以下方式启用 debug
级登录流:
For example, in the CorDapp Example (https://github.com/corda/samples), you could enable debug
-level logging in flows by:
- 更新
config / test / log4j2.xml
以更改info的日志记录级别
到调试
- 修改
VM选项
的设置运行流测试-Java
运行配置为-ea -javaagent:../ lib / quasar.jar -Dlog4j.configurationFile = .. / conf ig / test / log4j2.xml
- 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
这篇关于在Corda中,如何设置流量测试的日志记录级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!