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

Isolate logger to only output to specific target when using both File and Programmatic NLog configurations

I'm trying to do some very specific logging from inside a "common" class library which is going to be used by multiple web applications. The "consuming" web applications may or may not do some NLog logging of their own. I'd like to somehow isolate…
Jiveman
  • 1,022
  • 1
  • 13
  • 30
1
vote
1 answer

NLOG & Azure table storage

everything is logging just fine except for the fact that its recording 2 columns that I believe is causing Azure Storage Explorer to freak out when sorting via the application. See image below. Can anyone explain what the difference between…
David
  • 693
  • 7
  • 20
1
vote
0 answers

nlog - filter message based on the same threadname

Is it possible to use a filter on a bufferingwrapper? i want to send an email, with level = error and the the email should contain the last X log messages using a filter on the threadname that should be equal to the threadname where the error log…
Marco
  • 337
  • 3
  • 10
1
vote
1 answer

Nlog async thread and Garbage Collector causes process hang

We have a native/managed process which runs continuously in 20-30 instances with different configuration. Sometimes one of this processes just hangs and all that can be done is to kill the process and restart it. I have several dumps of this hanging…
1
vote
2 answers

nlog richtextbox - Target cannot be found: 'RichTextBox'

I had this working, but I tried to update nlog and use the nuget packages, including NLog.Windows.Forms. Now I am getting NLog.NLogConfigurationException with the inner exception: Target cannot be found: 'RichTextBox' The project references both:…
Derek
  • 7,615
  • 5
  • 33
  • 58
1
vote
1 answer

How to use NLog Configuration API to define a wrapper target?

I've seen plenty of examples of using the NLog Configuration API to create multiple targets that are linked to multiple rules. However, I cannot find any documentation on how to use the NLog Configuration API to set up a wrapper target around…
M.Bosse
  • 21
  • 3
1
vote
1 answer

NLog Custom Layout Renderer Integer

How do you get an integer value to come from a custom layout renderer? I am getting an exception when trying to use a custom layout renderer to set a property of a target that expects an integer. By stepping through the code, it looks like custom…
M.Bosse
  • 21
  • 3
1
vote
0 answers

NLog logger different configuration for different environments

I develop a web application using NLog logger. I want to have different logger configurations for the testing environment and the production environment Is there a best practice as to how to set the configuration for the NLog logger using existing…
user5326354
1
vote
1 answer

get the class name that requested Ninject service

I am abstracting away NLog. So far, what I have... public interface IAppLogger { void Info(string message); void Warn(string message); void Error(string message, Exception error); void Fatal(string message); ....// other…
ash
  • 2,902
  • 3
  • 19
  • 34
1
vote
1 answer

Get-ChildItem -Path in NLog file

If I have this: Get-ChildItem -Path $BACKUP_REG_PATH >> $TOT_LOG_FILE I will get a fine list in my log file like this: Directory: C:\WS\BACKUP\xxxx-Reg Mode LastWriteTime Length Name …
user1423277
  • 109
  • 2
  • 13
1
vote
0 answers

Custom contract on a LogReceiverService Nlog

I'm having at the moment a big solution with different projects sending logs with Nlog to LogReceiverService target. I would like to use an interface so I have only 1 installation of Nlog in 1 project of my solution. So I created a new interface to…
labelle
  • 420
  • 4
  • 19
1
vote
1 answer

What datasource for NlogViewer and ReflectInsight log viewer?

I am tasked with looking into providing a centralized place for logging. Then take those logs and provide a way to display them in a live viewer. We need a place to store the log history for audit reasons and reporting. We also want the ability to…
user1732364
  • 925
  • 4
  • 28
  • 58
1
vote
2 answers

Programmatically set the NLog target attributes

I am using NLog Azure Storage Logger. My config is as below, I don't want to put the storage key in the target. Instead, I will use it from app settings so that I can set the Azure website "Application Settings" in the deployment environment. How…
Dhanuka777
  • 8,331
  • 7
  • 70
  • 126
1
vote
2 answers

Integrate logger in existing code

I have existing MVC5 code where I need to integrate logging. Can anyone let me know the best way to integrate without making lot modifications in existing code. I have one approach where I am thinking of using MVC action filters for logging and DI…
Pritam
  • 1,288
  • 5
  • 23
  • 40
1
vote
1 answer

how to get Resolver class name in autofac?

I am registered Nlog in my Container builder like below: builder.Register( x=> LogManager.GetLogger("LoggerName")).As(); And my Controller constructor like below: public AccountController(NLog.ILogger logger) { …
ramin_rp
  • 321
  • 1
  • 4
  • 14
1 2 3
99
100