我在Dropwizard应用程序中使用Apache Ignite,似乎无法让Ignite仅通过slf4j登录。在应用程序启动之前,Dropwizard带有jul-to-slf4j桥和installs所有桥梁。
我已经按照instructions设置日志记录,但最终仍然有重复的日志:
IgniteConfiguration cfg = new IgniteConfiguration();
IgniteLogger log = new Slf4jLogger();
cfg.setGridLogger(log);
Ignite ignite = Ignition.start(cfg);
这是控制台输出:
INFO main o.a.i.i.IgniteKernal:
>>> __________ ________________
>>> / _/ ___/ |/ / _/_ __/ __/
>>> _/ // (7 7 // / / / / _/
>>> /___/\___/_/|_/___/ /_/ /___/
>>>
>>> ver. 2.3.0#20171028-sha1:8add7fd5
>>> 2017 Copyright(C) Apache Software Foundation
>>>
>>> Ignite documentation: http://ignite.apache.org
[10:34:32] __________ ________________
[10:34:32] / _/ ___/ |/ / _/_ __/ __/
[10:34:32] _/ // (7 7 // / / / / _/
[10:34:32] /___/\___/_/|_/___/ /_/ /___/
[10:34:32]
[10:34:32] ver. 2.3.0#20171028-sha1:8add7fd5
[10:34:32] 2017 Copyright(C) Apache Software Foundation
[10:34:32]
[10:34:32] Ignite documentation: http://ignite.apache.org
[10:34:32]
[10:34:32] Quiet mode.
[10:34:32] ^-- To see **FULL** console log here add -DIGNITE_QUIET=false or "-v" to ignite.{sh|bat}
[10:34:32]
输出中的第一行看起来像是通过slf4j,然后带有时间戳的那些看起来像是来自JUL。还有其他方法可以禁用JUL的内容吗?
我有同样的问题。确保将IGNITE_QUIET
环境变量设置为false。根据documentation:“请注意,安静模式下的所有输出都是通过标准输出(STDOUT)完成的。”
您可以在命令行上执行此操作,也可以调用
System.setProperty(org.apache.ignite.IgniteSystemProperties.IGNITE_QUIET, "false");
在致电Ignition.start()
之前。