0

Using Quartz.Net 3.1.3 with an ASP.NET Core app using Serilog and I'm trying to disable debug logging of quartz because it spams the logs in a production environment.

I'm setting the following in appsettings.json:

"Logging": {
    "LogLevel": {
      "System": "Warning",
      "Microsoft": "Warning",
      "MyCompanyNameSpace": "Information",
      "Quartz": "Warning"
    }
},

but I can still see that is logging:

2021-11-02 09:49:34.025 +02:00 [DBG] Calling Execute on job MyCompany.SyncJobGroup.SyncJobA
2021-11-02 09:49:34.154 +02:00 [DBG] Trigger instruction : DeleteTrigger
2021-11-02 09:49:34.154 +02:00 [DBG] Deleting trigger

How can I disable it?

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
pantonis
  • 4,526
  • 7
  • 46
  • 90

1 Answers1

1

The solution has two parts:

1.The following Serilog configuration is missing from appsettings.json to define the correct logging level for Quartz:

https://groups.google.com/forum/#!topic/quartznet/Cjco_Ob9yrM

"MinimumLevel": {
  "Default": "Debug",
  "Override": {
    "Microsoft": "Warning",
    "System": "Warning",
    "Quartz": "Warning"
  }
},

The configuration of "Quartz": "Warning" suppressed the Debug "Batch acquisition" messages from being logged.

And

2 - The invocation of both the SerilogLogger.Reconfigure and SerilogLogger.RefineConfiguration methods was completely unnecessary. I removed this. It was overwriting the config from point 1) above. All Serilog configuration should take place in my appsettings.

Tupac
  • 1,937
  • 2
  • 4
  • 15