Resource plugin logging: how to turn off?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Resource plugin logging: how to turn off?

Martijn Vos
Hi,

I'm using the otherwise excellent resources plugin, and it's spewing enormous amounts of logging info.
Now I don't pretend to understand how logger configuration in Grails works, but my impression was that you can always configure them by package hiertarchy.
So, considering the fact that most resources plugin code is in the package org.grails.plugin.resource', this should work:

  error 'org.grails.plugin.resource'

Yet it doesn't. The ResourceService, which is part of that package, still logs every single log.debug statement.

error 'org.grails.plugin' doesn't work either. From what I understand, info 'grails.app' would work, but that's no good if I still want to see some other debug info.

So my question is: what's the correct way to configure this? (And could somebody please add that to some documentation page?)


mcv.
Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

ld@ldaley.com

On 11/01/2011, at 9:09 PM, Martijn Vos wrote:

Hi,

I'm using the otherwise excellent resources plugin, and it's spewing enormous amounts of logging info.
Now I don't pretend to understand how logger configuration in Grails works, but my impression was that you can always configure them by package hiertarchy.
So, considering the fact that most resources plugin code is in the package org.grails.plugin.resource', this should work:

  error 'org.grails.plugin.resource'

Yet it doesn't. The ResourceService, which is part of that package, still logs every single log.debug statement.

error 'org.grails.plugin' doesn't work either. From what I understand, info 'grails.app' would work, but that's no good if I still want to see some other debug info.

So my question is: what's the correct way to configure this? (And could somebody please add that to some documentation page?)


Read the section on automatic loggers for services etc.
Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

Martijn Vos

Luke Daley <[hidden email]> wrote:

On 11/01/2011, at 9:09 PM, Martijn Vos wrote:

Hi,

I'm using the otherwise excellent resources plugin, and it's spewing enormous amounts of logging info.
Now I don't pretend to understand how logger configuration in Grails works, but my impression was that you can always configure them by package hiertarchy.
So, considering the fact that most resources plugin code is in the package org.grails.plugin.resource', this should work:

  error 'org.grails.plugin.resource'

Yet it doesn't. The ResourceService, which is part of that package, still logs every single log.debug statement.

error 'org.grails.plugin' doesn't work either. From what I understand, info 'grails.app' would work, but that's no good if I still want to see some other debug info.

So my question is: what's the correct way to configure this? (And could somebody please add that to some documentation page?)


Read the section on automatic loggers for services etc.

So if I want to disable logging from a plugin, I have to do it for each class of that plugin separately? 
The part under "Configuring loggers" suggested to me that the above should work. If it doesn't, that would mean only this would work:

  error 'grails.app.service.org.grails.plugin.resource.ResourceService'

Is that correct? Perhaps the text under "Configuring loggers" should be modified to make more explicit that configuring loggers by package name alone doesn't work for plugins (and possibly other direct grails components?).

In any case, I'll try this. Thanks.


mcv.
Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

pledbrook
> So if I want to disable logging from a plugin, I have to do it for each
> class of that plugin separately?

Not for every class, but for every artefact type. So your best bet in
this case is:

    error 'grails.app.service.org.grails.plugin.resource'

although I think the plugin only has the one service.

If you would like to see different behaviour, please comment (and
vote) on this issue:

    http://jira.codehaus.org/browse/GRAILS-6566

Peter

--
Peter Ledbrook
Grails Advocate
SpringSource - A Division of VMware

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

bdrhoa
I realize this is an old thread, but I've just started using the Resource Plugin in my new project with Grails 2.0 and I also have the question :How do you turn off the Resource Plugin's logging?  I added:

log4j = {
      . . .
     error 'grails.app.service.org.grails.plugin.resource'  
     ...
}

and then I also tried

 error 'grails.app.service.org.grails.plugin.resource.CSSPreprocessorResourceMapper'
 error 'grails.app.service.org.grails.plugin.resource.ResourceTagLib'

but none of that seem to have any affect.

What am I doing wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

bksaville
I believe it was changed to grails.app.services instead of
grails.app.service in Grails 2.  All the artifact logging was pluralized,
but I could be misremembering now.

Thanks,
Brian

-----Original Message-----
From: bdrhoa [mailto:[hidden email]]
Sent: Thursday, December 22, 2011 12:11 PM
To: [hidden email]
Subject: [grails-user] Re: Resource plugin logging: how to turn off?

I realize this is an old thread, but I've just started using the Resource
Plugin in my new project with Grails 2.0 and I also have the question :How
do you turn off the Resource Plugin's logging?  I added:

log4j = {
      . . .
     error 'grails.app.service.org.grails.plugin.resource'  
     ...
}

and then I also tried

 error
'grails.app.service.org.grails.plugin.resource.CSSPreprocessorResourceMapp
er'
 error 'grails.app.service.org.grails.plugin.resource.ResourceTagLib'

but none of that seem to have any affect.

What am I doing wrong?

--
View this message in context:
http://grails.1312388.n4.nabble.com/Resource-plugin-logging-how-to-turn-of
f-tp3208792p4226356.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

bdrhoa
Making progress:

          error 'grails.app.taglib.org.grails.plugin.resource.ResourceTagLib'  

cut out most of the noise, but

             error 'grails.app.conf.org.grails.plugin.resource.CSSPreprocessorResourceMapper' 
  
didn't work. I was guessing that   CSSPreprocessorResourceMapper was under grails.app.conf... but apparently not.

---------------------------
www.maf.org/rhoads
www.ontherhoads.org


On Thu, Dec 22, 2011 at 12:15 PM, Brian Saville <[hidden email]> wrote:
services

Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

dzava
Hi there,

Try the following:

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

Regards,
Dimitris


On Thu, Dec 22, 2011 at 10:24 PM, bdrhoa [via Grails] <[hidden email]> wrote:
Making progress:

          error 'grails.app.taglib.org.grails.plugin.resource.ResourceTagLib'  

cut out most of the noise, but

             error 'grails.app.conf.org.grails.plugin.resource.CSSPreprocessorResourceMapper' 
  
didn't work. I was guessing that   CSSPreprocessorResourceMapper was under grails.app.conf... but apparently not.

---------------------------
www.maf.org/rhoads
www.ontherhoads.org


On Thu, Dec 22, 2011 at 12:15 PM, Brian Saville <[hidden email]> wrote:
services




If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/Resource-plugin-logging-how-to-turn-off-tp3208792p4226539.html
To unsubscribe from Grails, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

Marc Palmer Local
Hi,

FWIW I'm wondering why you are getting lots of log noise from resources - this implies you have a default log level that is quite verbose i.e. debug?

It's better to not do this unless you want everything to come out. If you just want to debug your app, set debug on your packages.

Granted, its not as easy as it could be. It would be nicer if plugin artefacts were separated from the grails.app logs, so you could do:

error "grails.plugin"
debug "grails.app"

...and get debug only for your app. I will raise a JIRA for this in a future Grails release.

Marc


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

bdrhoa
In reply to this post by dzava
That works, thanks!
---------------------------
www.maf.org/rhoads
www.ontherhoads.org


On Thu, Dec 22, 2011 at 3:23 PM, dzava <[hidden email]> wrote:
Hi there,

Try the following:

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

Regards,
Dimitris


On Thu, Dec 22, 2011 at 10:24 PM, bdrhoa [via Grails] <[hidden email]> wrote:
Making progress:

          error 'grails.app.taglib.org.grails.plugin.resource.ResourceTagLib'  

cut out most of the noise, but

             error 'grails.app.conf.org.grails.plugin.resource.CSSPreprocessorResourceMapper' 
  
didn't work. I was guessing that   CSSPreprocessorResourceMapper was under grails.app.conf... but apparently not.

---------------------------
www.maf.org/rhoads
www.ontherhoads.org


On Thu, Dec 22, 2011 at 12:15 PM, Brian Saville <[hidden email]> wrote:
services




If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/Resource-plugin-logging-how-to-turn-off-tp3208792p4226539.html
To unsubscribe from Grails, click here.
NAML



View this message in context: Re: Resource plugin logging: how to turn off?

Sent from the Grails - user mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

bdrhoa
In reply to this post by Marc Palmer Local
Yep, debugging my app.

Thanks for all your work, Marc!
---------------------------
www.maf.org/rhoads
www.ontherhoads.org


On Fri, Dec 23, 2011 at 3:06 AM, Marc Palmer <[hidden email]> wrote:
Hi,

FWIW I'm wondering why you are getting lots of log noise from resources - this implies you have a default log level that is quite verbose i.e. debug?

It's better to not do this unless you want everything to come out. If you just want to debug your app, set debug on your packages.

Granted, its not as easy as it could be. It would be nicer if plugin artefacts were separated from the grails.app logs, so you could do:

error "grails.plugin"
debug "grails.app"

...and get debug only for your app. I will raise a JIRA for this in a future Grails release.

Marc


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

dzava
In reply to this post by Marc Palmer Local
Hi Marc, sorry for the late reply.

In my case, the default log level has always been "error" (see below** for details).
However, after upgrading to Grails 2.0.0.RC3 (as well as Grails 2.0.0 GA), I started getting tons of log messages from the Resources and Navigation plugins, so I had to modify my log config as shown below in order to get it back to normal.

I didn't consider it too much of an issue, so I never reported it as a bug (running Windows XP 32bit and Java 1.6.0_27). Shall I do so?

Regards,
Dimitris


**
def logPattern = '%d{yyyy-MM-dd HH:mm:ss,SSS} %p %c{2} - %m%n'
log4j = {
    appenders {
        console name: 'stdout', layout:pattern(conversionPattern: logPattern)
        'null' name: 'stacktrace'
        environments {
            production {
                appender new DailyRollingFileAppender(name: 'fileAppender', datePattern: "'.'yyyy-MM-dd", fileName: "myapp.log", layout: pattern(conversionPattern: logPattern))
                'null' name: 'stdout'
            }
        }
    }
   
    root {
        error 'stdout', 'fileAppender'
    }
   
    error  'org.codehaus.groovy.grails.web.servlet',
           'org.codehaus.groovy.grails.web.pages',
           'org.codehaus.groovy.grails.web.sitemesh',
           'org.codehaus.groovy.grails.web.mapping.filter',
           'org.codehaus.groovy.grails.web.mapping',
           'org.codehaus.groovy.grails.commons',
           'org.codehaus.groovy.grails.plugins',
           'org.codehaus.groovy.grails.orm.hibernate',
           'org.springframework',
           'org.hibernate',
           'net.sf.ehcache.hibernate',
          
           //~~ added the following after upgrading to Grails 2.0.RC3 ~~
           'grails.app.services.org.grails.plugin.resource',
           'grails.app.taglib.org.grails.plugin.resource',
           'grails.app.resourceMappers.org.grails.plugin.resource',
           'grails.app.services.NavigationService'
           // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
    warn    'org.mortbay.log'
   
    debug    'com.myapp',
               'grails.app'
     
    environments {
        production {
            info    'com.myapp',
                    'grails.app'
        }
    }
}



On Fri, Dec 23, 2011 at 12:08 PM, Marc Palmer Local [via Grails] <[hidden email]> wrote:
Hi,

FWIW I'm wondering why you are getting lots of log noise from resources - this implies you have a default log level that is quite verbose i.e. debug?

It's better to not do this unless you want everything to come out. If you just want to debug your app, set debug on your packages.

Granted, its not as easy as it could be. It would be nicer if plugin artefacts were separated from the grails.app logs, so you could do:

error "grails.plugin"
debug "grails.app"

...and get debug only for your app. I will raise a JIRA for this in a future Grails release.

Marc


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/Resource-plugin-logging-how-to-turn-off-tp3208792p4228032.html
To unsubscribe from Grails, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Resource plugin logging: how to turn off?

bilalahmed
In reply to this post by bdrhoa
Hi,

 I also want to disable all logging made from grails resource plugin. Did you find any working workaround? Can you please share final working answer?

Thanks