Code:
public class TestLog{
private static final Logger logger = LoggerFactory.getLogger(TestLog.class);
public static void main(String[] args) {
logger.info("test log");
}
}
Console output:
G:\work\Workspaces\eclipse20151214\Pack\target>java -cp Pack-0.0.1-SNAPSHOT.jar com.zzy.pack.TestLog
log4j:WARN No appenders could be found for logger (com.zzy.pack.TestLog).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.