BAEL-4724 Fixing log4j's "no appender found" warning (#10802)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.baeldung.log4j;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class NoAppenderExample {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(NoAppenderExample.class);
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
//Setup default appender
|
||||
//BasicConfigurator.configure();
|
||||
|
||||
//Define path to configuration file
|
||||
//PropertyConfigurator.configure("src\\main\\resources\\log4j.properties");
|
||||
logger.info("Info log message");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user