0

I am trying to disable Logging with NLog for Hangfire jobs, I tried this but it didn't work:

  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Hangfire" : "None"
    }

I am using ASP.NET Core 3.1 Web API Project

NLog version: 4.7.6

NLog.Web.AspNetCore version: 4.10.0

Hangfire version: 1.7.27

Cannot I disable it from appsettings.json? Instead of using NLog Logging Rules & Filters, or using some custom NoOpLogger for Hangfire like this?

Note: I am using only one rule for my NLog target:

var rule= new LoggingRule("*", LogLevel.Trace, LogLevel.Fatal, myCustomTarget)
Hussein Dahir
  • 395
  • 4
  • 14

0 Answers0