有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

来自Ignite的java重复日志记录

我在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,然后带时间戳的行看起来像是来自七月。有没有其他方法来禁用七月的内容


共 (1) 个答案

  1. # 1 楼答案

    我也有同样的问题。确保将IGNITE_QUIET环境变量设置为false。根据documentation:“注意,安静模式下的所有输出都是通过标准输出(STDOUT)完成的。”

    您可以在命令行上执行此操作,也可以调用

    System.setProperty(org.apache.ignite.IgniteSystemProperties.IGNITE_QUIET, "false");
    

    在调用Ignition.start()之前