NLog

NLog is a logging platform for .NET with rich log routing and management capabilities. NLog supports traditional logging, structured logging and the combination of both. Supported platforms: - .NET 5, 6, 7 and 8 - .NET Core 1, 2 and 3 - .NET Standard 1.3+ and 2.0+ - .NET Framework 3.5 - 4.8 - Xamarin Android + iOS (.NET Standard) - Mono 4 For ASP.NET Core, check: https://www.nuget.org/packages/NLog.Web.AspNetCore


Keywords
NLog, console, database, email, eventlog, log, logfiles, logging, structured, tracing, c-sharp, csharp, dotnet, dotnet-core, logger, logging-library, net6, net8, netcore, netstandard, netstandard20, structured-logging, uwp, xamarin
License
BSD-3-Clause
Install
Install-Package NLog -Version 5.0.0-beta10

Documentation

NLog

NuGet Semantic Versioning NuGet downloads

Coverage

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

It can process diagnostic messages emitted from any .NET language, augment them with contextual information, format them according to your preference and send them to one or more targets such as file or database.

Major and minor releases will be posted on project news.

Getting started

For the possible options in the config, check the Options list and API Reference

Having troubles? Check the troubleshooting guide


ℹ️ NLog 5.0 Released!

NLog 5.0 is finally here. See List of major changes in NLog 5.0

NLog Packages

The NLog-nuget-package provides everything needed for doing file- and console-logging. But there are also multiple NLog extension packages, that provides additional target- and layout-output. See targets and layout renderers overview!

See Nuget/build status of all official packages here

Questions, bug reports or feature requests?

Issues with getting it working? Please check the troubleshooting guide before asking! With a clear error message, it's really easier to solve the issue!

Unclear how to configure NLog correctly of other questions? Please post questions on StackOverflow.

Do you have feature request or would you like to report a bug? Please post them on the issue list and follow these guidelines.

Frequently Asked Questions (FAQ)

See FAQ on the Wiki

Contributing

As the current NLog team is a small team, we cannot fix every bug or implement every feature on our own. So contributions are really appreciated!

If you like to start with a small task, then up-for-grabs are nice to start with.

Please note, we have a dev and master branch

  • master is for pure bug fixes and targets NLog 4.x
  • dev targets NLog 5

A good way to get started (flow)

  1. Fork the NLog repos.
  2. Create a new branch in you current repos from the 'dev' branch. (critical bugfixes from 'master')
  3. 'Check out' the code with Git or GitHub Desktop
  4. Check contributing.md
  5. Push commits and create a Pull Request (PR) to NLog

Please note: bugfixes should target the master branch, others the dev branch (NLog 5)

License

NLog is open source software, licensed under the terms of BSD license. See LICENSE.txt for details.

How to build

Use Visual Studio 2019 and open the solution 'NLog.sln'.

For building in the cloud we use:

  • AppVeyor for Windows- and Linux-builds
  • SonarQube for code coverage

Trying to build your fork in the cloud? Check this how-to

Note: master points to NLog 4.x and dev to NLog 5.x