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
43
votes
7 answers

Delete log files after x days

I would like to log with Nlog using the file target like in this example. How can I realize a deletion of the files after X days without archiving them? Or is it possible to archive the files to the same folder?
Freddy
  • 693
  • 2
  • 6
  • 12
43
votes
2 answers

Global exception handling in ASP.NET Web API 2.1 with NLog?

ASP.NET Web API 2.1 includes a new global error handling capability. I found an example that demonstrates how to log exceptions into ELMAH. But I use NLog to log errors to a database table. Is it possible to use Web API global error handling with…
demo
  • 6,038
  • 19
  • 75
  • 149
43
votes
6 answers

Logging in multiple files using NLog

I am using NLog for logging purpose. My code is as follows: