Welcome to NLog!
NLog is a flexible and free logging platform for various .NET platforms, including .NET standard. NLog makes it easy to write to several targets. (database, file, console) and change the logging configuration on-the-fly.
NLog has support for structured and traditional logging.
The focus for NLog: high performance, easy-to-use, easy to extend and flexible to configure.
Easy to configure
Every log message can be templated with various layout renders
Full support for structured logging and handles both message-templates and custom logevent properties.
Microsoft Extension Logging
NLog can be fully integrated with Microsoft Extensible Logging (and ASP.NET Core), without it needing to replace the standard Microsoft LoggerFactory. NLog automatically captures LogEvent properties and can use them in structured logging target output.
Targets are used to display, store or pass log messages to another destination. NLog can dynamically write to one of multiple targets for each log message.
There are more than 30 targets provided out-of-the-box, including:
FilesWrite logs to any number of files, with automatic file naming and archival.
Event LogWrite to event log local or remote
DatabaseStore your logs in databases supported by .NET
There are also wrapper targets which provide buffering, load balancing, failover situations, asynchronous writing and many more scenarios. The full list of targets is available on the config options page. If you didn't find the target to fit your needs, you can easily write a custom one.
- .NET 5 & 6 (.NET Standard 2.0)
- .NET Framework 3.5 - 4.8
- .NET Core 1.0 - 3.1
- Xamarin Android + iOS (.NET Standard)
- UWP (.NET Standard)
- Mono 4
- ASP.NET Core (NLog.Web.AspNetCore package)
- ASP.NET Classic (NLog.Web package)
The source code is available under the terms of BSD license.