0

I am working on Grails application with resources plugin and Log4j for logging. I want to disable logging from resources plugin as it's not useful for me and just filling my logging file with useless information. Such as:

File [file] changed. Applying changes to application.
Scheduling reload of resource files due to change of file [file]
Performing a changed file reload
Loading declared resources...
Finished changed file reload 

I don't want such information in my logs file as Its not useful for me and this is making difficult too reading other useful info in my log files.

Is there any way that I may disable logging from specific modules such as resource ?

I have tried the following Solution:

off 'grails.app.services.org.grails.plugin.resource',
'grails.app.taglib.org.grails.plugin.resource',
'grails.app.resourceMappers.org.grails.plugin.resource' 

But this didn't help me.

1 Answer 1

0

You have tried various package/class name combinations without success. Since your sample log outputs do not include the class name, you don't know what you should target. If you modify the format used for log messages, you can see the exact name you need to block.

An example:

//time, log level, thread, class, message, newline
console name: 'myAppender', layout: pattern(conversionPattern: '%d | %p | %t | %c | %m%n')
root {
    info 'myAppender'
}

Once you do that, you should see output like this:

2015-02-17 10:53:06,536 | INFO | localhost-startStop-1 | org.hibernate.tool.hbm2ddl.SchemaUpdate | schema update complete

To suppress that line of output, you'd target

org.hibernate.tool.hbm2ddl.SchemaUpdate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.