Welcome to NLog

NLog is a free logging platform for .NET, Silverlight and Windows Phone with rich log routing and management capabilities. NLog makes it easy to produce and manage high-quality logs for your application regardless of its size or complexity.

NLog can process diagnostic messages emitted from any .NET language (C#, VB.NET etc.), augment them with contextual information (date and time, severity, thread, process, environment), format according to your preferences and send to one or more targets.

.NET, C/C++ and COM interop APIs are supported so that all your application components including legacy modules written in C++/COM can route their log messages through a common engine.

Features

Easy to configure

NLog is very easy to configure, both through configuration file and programmatically. The easy-to-use logger pattern known from log4net.

Extensible

Even though NLog has targets and pre-defined layouts, you can write custom targets or pass custom values

Cross platform

NLog has cross-platform support: .NET Framework, .NET Compact Framework and Mono (on Windows and Unix)

Targets

Targets are used to display, store or pass log messages to another destination.

There are more than 30 targets provided out-of the box, including:

Files

Write logs to any number of files, with automatic file naming and archival

Event Log

Write to event log local or remote

Database

Store your logs in databases supported by .NET

Console

Write real-time to the command-line console including color coding of messages

E-mail

You can send emails whenever application errors occur

ASP.NET trace

Write log messages to the built in trace in ASP.NET

There are also wrapper targets which provide buffering, load balacing, failover situations, asynchronous writing and many more scenarios. The full list of targets is available on the wiki. If you didn't find the target to fit your needs, you can easily write a custom one.

License

The source code is available under the terms of BSD license.