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.
For more information, see the website nlog-project.org or just get started with the tutorials on the NLog wiki.
Major releases will be posted on project news. For smaller updates, follow us on Twitter
-
For ASP.NET Core 1 users, see installation instructions
-
For ASP.NET Core 2 users, see installation instructions
-
ASP.NET (classic) users:
- Install NLog.Config NuGet package
- recommended, install also install NLog.Web NuGet package
-
Others:
- Install NLog.Config NuGet package
More detailed tutorial can be found here.
For the possible options in the config, check the Target list and the layout renderer list
Having troubles? Check the troubleshooting guide
ℹ️ Looking for NLog 5? Just install NLog 4.5!
NLog 4.5 implements the platforms added in NLog 5 (.NET Standard 1, .NET Standard 2, UWP, etc) and added structural logging, without breaking changes!
NLog consists of multiple packages. Most of the functionality is inside the NLog (core) package. What's inside the packages? See targets and layout renderers overview!
Package | Build status | NuGet |
---|---|---|
NLog | ||
NLog.Extensions.Logging | ||
NLog.Config | ||
NLog.Contrib.ActiveMQ | ||
NLog.Extended | ||
NLog.Elmah | ||
NLog.Etw | ||
NLog.InstallNLogConfig | ||
NLog.MailKit | ||
NLog.ManualFlush | ||
NLog.Schema | ||
NLog.Web | ||
NLog.Web for ASP.NET Core | ||
NLog.Windows.Forms | ||
NLog.Owin.Logging |
Do you have feature request or would you like to report a bug? Please post them on the issue list and follow these guidelines. Please post questions on StackOverflow.
See FAQ on the Wiki
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.
A good way to get started (flow)
- Fork the NLog repos.
- Create a new branch in you current repos from the 'master' branch.
- 'Check out' the code with Git or GitHub Desktop
- Check contributing.md
- push commits and create a Pull Request (PR) to NLog
NLog is open source software, licensed under the terms of BSD license. See LICENSE.txt for details.
Use Visual Studio 2017 and open the solution 'NLog.sln' - C# 7.0 support is required.
For building in the cloud we use:
- AppVeyor for Windows builds, including Silverlight and Xamarin.
- Travis for Mono builds.
- CodeCov for code coverage
Trying to build your fork in the could? Check this how-to