Search code examples
javaslf4jdropwizardignitejul-to-slf4j

Duplicate logging from Ignite


I'm using Apache Ignite within a Dropwizard app and can't seem to get Ignite to only log through slf4j. Dropwizard comes with the jul-to-slf4j bridge and installs all the bridges prior to app startup.

I've followed the instructions for setting up logging, but still end up with duplicate logs:

IgniteConfiguration cfg = new IgniteConfiguration();
IgniteLogger log = new Slf4jLogger();
cfg.setGridLogger(log);
Ignite ignite = Ignition.start(cfg);

Here's the console output:

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] 

The first lines in the output look like they went through slf4j and then the timestamped ones look like they're coming from JUL. Is there some other way to disable what's coming from JUL?


Solution

  • I had this exact same issue. Make sure you set the IGNITE_QUIET environment variable to false. According to the documentation: "Note that all output in quiet mode is done through standard output (STDOUT)."

    You can either do this on the command line, or call

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

    Before the call to Ignition.start().