I am using Quartz.NET for scheduling some custom tasks in our application. Everything works fine except that it logs about twenty debug entries in one second.
I don't know how to turn off the debug logging. Any help would be really appreciated as I have been trying to lookup in the net with no luck.
The debug entries look like the below
DEBUG 2009-05-12 03:24:14,000 8612670ms StdRowLockSemaphore ObtainLock - Lock 'TRIGGER_ACCESS' is desired by: SchedulerFactory_QuartzSchedulerThread
DEBUG 2009-05-12 03:24:14,029 8612699ms StdRowLockSemaphore ExecuteSQL - Lock 'TRIGGER_ACCESS' is being obtained: SchedulerFactory_QuartzSchedulerThread
DEBUG 2009-05-12 03:24:14,029 8612699ms StdRowLockSemaphore ObtainLock - Lock 'TRIGGER_ACCESS' given to: SchedulerFactory_QuartzSchedulerThread
DEBUG 2009-05-12 03:24:14,034 8612704ms StdRowLockSemaphore ReleaseLock - Lock 'TRIGGER_ACCESS' returned by: SchedulerFactory_QuartzSchedulerThread
DEBUG 2009-05-12 03:24:14,035 8612705ms StdRowLockSemaphore ObtainLock - Lock 'TRIGGER_ACCESS' is desired by: SchedulerFactory_QuartzSchedulerThread
DEBUG 2009-05-12 03:24:14,035 8612705ms JobRunShell Run - Calling Execute on job DEFAULT.ProcessIncomingMTRJob
Using Quartz with slf4j-simple The slf4j-simple is so simple, you don't even need to configure anything. Just add the dependency into your Maven project, and you are good to go! Then it will default logging INFO level messages. If you want to see DEBUG verbose messages, then add this System Property -Dorg.
Quartz is not using log4j, but it's using java. util. logging. Logger.
When you enable debug logging, the component writes debug messages to its system. log file. Note: Enabling debug logging can cause the system. log file for a component to grow very large in size, and can affect the overall system performance.
Rytmis' answer is great if you want to reduce all your logging which goes through the Common Logging Infrastructure.
But if you have more code logging through Common Logging, and you just want to reduce the ammount of logging from Quartz (and not from the rest of the your code), what I recomend is this:
In the log4net config xml (app.config
usually) you probably already have something like this:
<root>
<level value="ALL" />
<appender-ref ... />
...
</root>
Leave that as it is. And after that (or anywhere inside the <log4net>
config section) just add this:
<logger name="Quartz">
<level value="ERROR" />
</logger>
This <logger>
section will configure all the loggers with the namespace "Quartz". So in this example Quartz will be logging with level ERROR
while the rest of my app will log with level ALL
.
If any one needs to do this in NLog just add the following as the top most rule in NLog.Config
<!-- Disable Quartz info logging -->
<logger name="Quartz*" minlevel="Trace" maxlevel="Info" final="true" />
Note that this will still let Warn, Error, Fatal go to the other loggers if you don't want that change maxlevel="Info"
to maxlevel="Fatal"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With