Questions tagged [nlog.config]

The default config file for the NLog logging framework

16 questions
3
votes
3 answers

How to unlock NLog.config on Visual Studio 2019

After installing NLog and NLog.config using NuGet package manager I am unable to edit NLog.config, it shows lock icon on it. How to unlock it?
2
votes
1 answer

Does not render NLog property value in logs when using ScopeContext.PushProperty in OnActionExecutedAsync()

NLog Property added to log in OnActionExecutedAsync() does not render in logs. This is ActionFilterAttribute code /// /// After invoke the action method /// public override Task OnActionExecutingAsync(HttpActionContext…
2
votes
1 answer

Log only Errors to StdErr Output Stream with NLog

NLog supports adding the error="true" key-value pair to the target XML node as documented here: https://github.com/NLog/NLog/wiki/Console-target However, I notice this outputs all logs to the StandardError stream, not just Error level logs. For…
user1477388
  • 20,790
  • 32
  • 144
  • 264
2
votes
0 answers

How can I use NLog library in .net core Console App?

I have an .net core console application for chatting. I have two console app in my solution that names Client and Server. I want to log my activities. And I use nLog library for that. I implemented nlog and nlog.config Nuget Packages from Nuget…
1
vote
0 answers

How to change NLog.config file location in Visual Studio

NLog has been a great tool so far, and I'm not sure how this problem hasn't popped up earlier. The issue is this. I have 2 similar, but unique projects which I'm working on side by side. (Different projects on different folders, both using Studio…
jdosser
  • 143
  • 1
  • 7
1
vote
2 answers

Set ApplicationData folder on app.config and get it on Nlog.config

I'd like to set the path of NLog log file on app.config. I know how to set the applicationData folder on NLog.config. It's like that:
Carlos Busca
  • 135
  • 8
1
vote
1 answer

NLog: Generate configurations at runtime from template

I'm trying to generate targets & logger at runtime, based on another target. Let's assume that I have a functionnal Foo logger: I'd like to generate separate rules for Foo.1, Foo.2, etc etc, but I can't know what will be the last logger I'll have to…
1
vote
1 answer

NLog nlog.config for asp.net core duplicate rules

I am trying to apply NLog to my ASP.NET core application. I am following the guide from NLog website: https://github.com/NLog/NLog.Web/wiki/Getting-started-with-ASP.NET-Core-2 The below is the rules suggested for nlog.config