Home - MikeHanson/NLog.Mvc GitHub Wiki
NLog.Mvc is a small project designed to make it easy and painless to integrate logging with NLog into ASP.NET MVC. However as demonstrated by the unit test project included in the source it could be used in almost any .NET project.
Currently the project provides two key features:
- An NLog target that uses an Entity Framework 4.* DbContext to write log entries to a database
- A custom HandleErrorAttribute that can be used to automatically log exceptions using the NLog target.
It also provides a logger utility class that wraps the NLog Logger for use anywhere in your application to write log messages.
The source code provides basic usage examples, and of course you can build the source to get your hands on the binaries, but to get started I recommend you use the NuGet package by running the following command in Package Manager Console:
Install-Package NLog.Mvc
Once you have done this you can read the following pages to get setup and logging with NLog.Mvc.
[Configuring the NLog target](wiki/Configuring the NLog target)
[Logging from your code](wiki/Logging from your code)
[Using the NLogMvcHandleErrorAttribute](wiki/Using the NLogMvcHandleErrorAttribute)