I'm trying to get a Hello World app working with groovy/log4j/ubuntu (working with Groovy 1.7.10). By default, I get no output to the console:
- Created ~/.groovy/lib, and downloaded the latest log4j jar into there.
- Created a.groovy:
cat a.groovy:
#! /usr/bin/groovy
import org.apache.log4j.Logger
def log = Logger.getLogger(getClass())
println "Log starting"
log.info("This is Info")
log.error("This is error")
println "Log finished"
Gave it permissions and ran it, and got:
Log starting
Log finished
Shouldn't the default config created a console appender and output to console?
As per this answer, I tried adding a call to org.apache.log4j.BasicConfigurator.configure();
, but that didn't change anything.