Questions tagged [nlog]

NLog is a free logging platform for .NET

NLog is a logging platform for .NET with support for structured logging. NLog enables easy routing and filtering of output to various targets.

Resources

2784 questions
1
vote
1 answer

How to set skipframes callsite on a NLogViewerTarget for Sentinel log viewer

I have var sentinalTarget = new NLogViewerTarget() { Name = "sentinal", Address = "udp://127.0.0.1:9999", IncludeCallSite = true, IncludeSourceInfo = true }; sentinalTarget.Parameters.Add(new NLogViewerParameterInfo() { Name…
1
vote
1 answer

NLog 2.1 EventId for EventLog not working when not specified

I am using Nlog 2.1 and trying to write errors into Windows Event logger with different eventId. To better distinguish different errors. If I specify eventId property it's working, but if don't I am not seeing any record in Windows Event Logger.…
Farukh
  • 2,173
  • 2
  • 23
  • 38
1
vote
1 answer

Nlog variable and log file issue with multiple log files

I created a Log File class that uses NLog with the hopes of writing to multiple log files at the same time. This seems to work fine until I add variables to the mix. Problem Changing the variable seems to change that variable setting for all…
Andrew
  • 437
  • 7
  • 18
1
vote
1 answer

Net Core NLog.Web "aspnet-request:header" property usage?

Is there any way to log all headers using "aspnet-request:header" property with one parameter? Or should I get headers one by one like "aspnet-request:header=MyHeader" and combine them into one parameter before insert? I have lots of headers and…
kizilsu
  • 431
  • 3
  • 13
1
vote
3 answers

HttpClient in an NLog target

I need to create a Target that uses HttpClient. HttpClient does not contain any synchronous methods, they are all Task returning Async calls. What is the best way to use this in an NLog target, seeing as the api does not seem to be async/await…
Dismissile
  • 32,564
  • 38
  • 174
  • 263
1
vote
4 answers

NLog does not write to file in Asp.net Core

I am using NLog in my Asp.net Core Application, but NLog is not able to write in file, i have all ready change permission of file,but still facing proble. file gets created,on first time but unable to write log in that file. Here is my nlog.config…
Jani Devang
  • 1,099
  • 12
  • 20
1
vote
1 answer

In which layer, should I do logging for MVC with many layers

I have a MVC project which has Model,DataAccess,Business and View layers. I am intending to use NLog to log exceptions into text files. I am not sure in which layer I should log errors, that is my first question. I read some blogs which recommend to…
Arif YILMAZ
  • 5,754
  • 26
  • 104
  • 189
1
vote
1 answer

How do I store my Logs to Azure Table Store from Asp Net Core WebApi?

I have ASP .Net Core WebApi application that is using .Net Framework 4.6. I am using NLog for logging. I want to log to Azure Table Storage. For that I am using AzureTableStorageNLogTarget and NLogExtensions.Logging Nuget Packages. Latest Stable…
Pankaj
  • 27
  • 7
1
vote
2 answers

How is NLog binded to ILogger with Ninject & Ninject.Extensions.Logging

Hi I am trying to use NLog with an Web Api 2 application that uses Ninject for dependency injection. I have struggled to find any concrete info on how to do this so far I have installed the NuGet packages for NLog & NLog.Configuration. So far what I…
Jeff Finn
  • 1,975
  • 6
  • 23
  • 52
1
vote
1 answer

NLog - RabbitMQ Cluster Target

We are using NLog in our .Net application to feed logs to ELK. The data flow is as below, NLog -> RabbitMQ -> Logstash -> Elasticsearch -> Kibana We have created RabbitMQ cluster(3 nodes with highly available queues) and unsure on how to…
Devrath N D
  • 601
  • 2
  • 8
  • 19
1
vote
1 answer

Nlog console target not working mono?

I have a very simple console app. I've added Nlog with the console target, but I can't get it to work when running in mono (on windows and ubuntu). I've tried the file target and it works. What am I missing? Code class Program { private static…
pogorman
  • 1,641
  • 2
  • 22
  • 41
1
vote
1 answer

Is there a way to redirect output to external console from NLog in ASP.NET?

I just started using NLog in my asp.net application, and I need to see log messages in real time. When I run it in VS2010 I can look at VS output window, but when I run it on the test box I obviously don't have that option. What I need is when my…
Andrey
  • 20,487
  • 26
  • 108
  • 176
1
vote
1 answer

Sentinel configuration with NLog/log4net

I have just started to use logging for my C# application. I am using NLog for logging entries to a *.log file and I view it using a Notepad++. I want to try Sentinel, although I can view the logs on sentinel, I am not sure with the initial steps of…
Rene Duchamp
  • 2,429
  • 2
  • 21
  • 29
1
vote
1 answer

Does NLog cache the data from NLog.config?

I'm writing a Windows Service, and thought it better to create a new Logger in each call of OnStart, vs. in the service constructor. That way, I hope changes to the config file will become effective when the service is restarted, without having to…
ProfK
  • 49,207
  • 121
  • 399
  • 775
1
vote
1 answer

NLog - log only one rule from several based on ocurrence of errors

I have the following rules on a NLog.config file:
Liordino Neto
  • 59
  • 1
  • 13