I’m working on a new Groovy app which uses log4j for logging, but when I use the conversion pattern symbols to insert the class or method name of the caller into the log output, I get the native java class/method names, not the groovy ones. For example:
The conversion pattern
"%d{dd-MM-yyyy HH:mm:ss,SSS} Digitizer: [%p] [%C.%M] %m%n"
gives me output like
13-07-2012 15:49:30,667 Digitizer: [DEBUG] [org.apache.log4j.Category$debug.call] Environment: dev
Clearly, log messages which always tell me the caller was log4j are not useful.
There is a reference to some log4j patch which looks like it might solve this problem on the groovy site at http://docs.codehaus.org/display/GROOVY/Logging, but that page has not been updated in well over a year and the link provided there gives a 404.
Does anyone know where I can find this mysterious log4j patch, or of any other way of getting meaningful caller information in my log messages, short of actually hard-coding it into each logger call?
http://web.archive.org/web/20100724050702/http://www.kotek.net/projects/log4j-groovy
However it is probably not working with the current Version of groovy.