I have this example of Log4J configuration.
Logger log = Logger.getRootLogger();
BasicConfigurator.configure(); // Basic configuration for Log4J 1.x
ConsoleAppender console = new ConsoleAppender(); //create appender
//configure the appender
console.setLayout(new PatternLayout("%d{dd/MM/yyyy HH:mm:ss} %m%n"));
console.setThreshold(Level.DEBUG);
console.activateOptions();
//add appender to any Logger (here is root)
Logger.getRootLogger().addAppender(console);
Into the console I get this output:
0 [FelixStartLevel] INFO root - test____scs
26/12/2013 14:15:10 test____scs
This message 0 [FelixStartLevel] INFO root - test____scs is printed by the code Logger log = Logger.getRootLogger(); How i can disable this code?
26/12/2013 14:15:10 test____scs- user31366660 [FelixStartLevel] INFO root - test____scs log4j:ERROR No output stream or file set for the appender named [null].- user3136666