Updating log4j 1.x to 2.x

I’ve used Log4J 1.x for ages, and not even realized that the 1.x code line is not maintained any more, it seems all the activity is on 2.x as the latest maintained version of the framework. To move from 1.x to 2.x, there’s a few changes: If you’re using Maven for your dependencies, replace <dependency> <groupId>log4j</groupId> …

Minimal log4j.properties file

Here’s a minimal log4j properties file defining a console appender and pattern formatter: log4j.rootLogger=DEBUG, console #console appender log4j.appender.console=org.apache.log4j.ConsoleAppender #define patternlayour for console appender log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d [%t] %-5p %c %x – %m%n