-
Notifications
You must be signed in to change notification settings - Fork 150
Closed
Labels
Description
Type: Bug
NLog version: 4.6.7
NLog.Extensions.Logging version: 1.5.1
NLog.Web.AspNetCore version: 4.8.4
Platform: .NET Core 2.2
Current NLog config
{
"NLog": {
"extensions": {
"NLog.Extensions.Logging": {
"assembly": "NLog.Extensions.Logging"
},
"NLog.Web.AspNetCore": {
"assembly": "NLog.Web.AspNetCore"
}
},
"targets": {
"console": {
"type": "Console",
"layout": "${level} | ${message}"
}
},
"rules": {
"console": {
"logger": "*",
"minLevel": "Trace",
"writeTo": "console"
}
}
}
}
I made a simple app based on the .Net Core API project template to reproduce the issue: https://github.com/mbcrawfo/nlog-dup
When you start the app, you'll notice that the messages written by NLog are duplicated four times:
If you modify launchSettings.json to remove the NLOG__RULES__CONSOLE__MINLEVEL environment variable, messages are only written once. Based on the internal config logging, it looks like the console rule is actually being processed four times:

