Minimal logging configuration with Java, SLF4J & Gradle

This is mainly here for my copying and pasting for a new Java project.

The gradle deps bring the SLF4J API in to the compile time classpath and the LOG4J implementation in to the runtime. If you wanted to compile the log4j implementation in to your code base (e.g. building an application and not a library), you would need to move it into the compile list.


dependencies {
    compile (
    testCompile (

log4j.rootLogger = info, CONSOLE
log4j.appender.CONSOLE = org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.conversionPattern = [%-5p] %m%n