• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

HowTo Disable Logging Output for classes using commons.logging

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I use log4j-1.2.8. In my new project I use quartz. Quartz gives me a lot of logging messages that I don't need. It's especially dangerous because It writes all of this output to the log file of the server.

I would like to get rid of this. The logging of quartz uses commons logging which can be manipulated through log4j says this resource:

http://jakarta.apache.org/commons/logging/guide.html#Configuring_Log4J

So I modified my log4j.properties in this way:

log4j.rootLogger=INFO, logfile,cons
log4j.appender.cons=org.apache.log4j.ConsoleAppender
log4j.appender.logfile=org.apache.log4j.RollingFileAppender

log4j.appender.logfile.File=/usr/local/log/accounts.log
log4j.appender.logfile.MaxBackupIndex=5

--> log4j.logger.org.quartz=ERROR
log4j.logger.org.apache=ERROR
log4j.appender.cons.Threshold=INFO


But still I get the INFO messages in the server log. What do I have to do?

Cheers,
Pete
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might have to set the additivity=false on the org.quartz category, so that the log messages are not propagated to the parent appenders. I have rarely used log4j.properties file for configuring log4j, so i dont have much idea how can achieve that through the properties file. But, here's a log4j.xml file that i would use to achieve the same effect:



Note that i have set the addivity=false on the category org.quartz
 
Pete Neu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

doesn't make any difference for me if the configuration is .properties or xml.
I tried your file and replaced it for the properties file. But it didn't have any effect. Seems like something is still missing. Any idea what to do?

cheers,
Pete
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apologies, looks like there's a mistake in the log4j.xml that i posted. Instead of:



It should be:



Note that i have removed the appender-ref of "cons" appender from the Quartz category. Let us know if you still see any issues.
 
Pete Neu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for having a second look at the problem. It seems that quartz has a strange way to do its logging. After I inserted the new configuration nothing changed so far. I still get lots of log info messages like this:


9.08.2006 11:32:18 org.quartz.plugins.history.LoggingJobHistoryPlugin jobToBeExecuted
INFO: Job JobInitializationPlugin.JobInitializationPlugin_jobInitializer fired (by trigger JobInitializationPlugin.JobInitializationPlugin_jobInitializer) at: 11:32:18 08/29/2006
29.08.2006 11:32:18 org.quartz.plugins.history.LoggingJobHistoryPlugin jobWasExecuted
INFO: Job JobInitializationPlugin.JobInitializationPlugin_jobInitializer execution complete at 11:32:18 08/29/2006 and reports: null
29.08.2006 11:32:28 org.quartz.plugins.history.LoggingJobHistoryPlugin jobToBeExecuted
INFO: Job JobInitializationPlugin.JobInitializationPlugin_jobInitializer fired (by trigger JobInitializationPlugin.JobInitializationPlugin_jobInitializer) at: 11:32:28 08/29/2006
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure that this log4j.xml is being picked up by the logger.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
la solution pour ton pb c d'enlev´┐Ż tout simplement la ligne du fichier quartz.properties
org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys

I have a similar issue where I want to turn-off all logging except the logging for my own classes. When I fire a request at my WEB Service, I get the logging below in addition to my own logging. How can I turn-off this "extra" logging?



I assume this is also log4j but maybe it isn't?

Any help is much appreciated.

Regards

Patrick
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic