Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off Debug Logging in Quartz .Net

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
like image 885
Ganesh Avatar asked May 18 '09 11:05

Ganesh


People also ask

How do I enable quartz logging?

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.

Does quartz use log4j?

Quartz is not using log4j, but it's using java. util. logging. Logger.

What does enable debug logging do?

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.


2 Answers

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.

like image 143
Mariano Desanze Avatar answered Sep 20 '22 15:09

Mariano Desanze


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"

like image 40
Peter Avatar answered Sep 17 '22 15:09

Peter