Been searching here and there looking for a working example of log4j logging to file in a Groovy script.
No explicit class (it\'s just a script). No grails. Not to conso
Another way to do this would be to use Groovy's logging package. You can use the same easily my importing the util logging and using the @Log annotation like in this example
import groovy.util.logging.*
@Log
class Test{
public class() {
log.debug "Logging"
}
}
However, since the annotation works on a class, you would need to create your groovy script inside a class. Free form scripts don't get the logger access this way.
Hope this helps.