Is there a way to write into the server log from a groovlet script? I've tried the following to no avail:
- Create a class with
@Log4jannotation within the groovlet (@Log4jworks fine in the rest of the project)
@Log4j('LOGGER')
class Log {
static Logger getLogger() {
LOGGER
}
}
- Use
ServerContextinstance implicit variableapplication:
application.log('Hello world')
Any ideas welcome, thanks.
The logs didn't appear using the first method because of
Log4jfiltering onlog4j.properties.I created a separate class
GroovletLoggerinside one of our unfiltered packages and I can log fine from groovlets.