Logging is a fundamental part of applications, and every application has a different flavor of logging mechanism. An application log is a file of events that are logged by a software application. It contains errors, informational events, and warnings.
- Logs save many valuable hours for both the support team or developers.
- As users execute programs at the front end, the system invisibly builds a vault of event information (log entries) for system administrators and the support team.
Logging usually involves writing text messages to log files or sending data to monitoring applications. There are many logging libraries/frameworks which take few minutes to setup and start logging solution for your projects.
In this article, we will discuss the top 10 Logging libraries, or you can say the most useful libraries which are used in 2017.
1. log4net By Apache.Logging
The Apache log4net library is a tool to help the programmer output log statements to a variety of output targets.
- In case of problems with an application, it is helpful to enable logging so that the problem can be located.
- With log4net it is possible to enable logging at runtime without modifying the application binary.
- The log4net package is designed so that log statements can remain in shipped code without incurring a high-performance cost.
- It follows that the speed of logging (or rather not logging) is crucial.
For further details, you can visit http://logging.apache.org/log4net/
2. NLog By jkowalski
NLog is a free logging platform for .NET, NETSTANDARD, Xamarin, Silverlight and Windows Phone with rich log routing and management capabilities. It can help you produce and manage high-quality logs for your application regardless of its size or complexity.
For further details, you can visit http://nlog-project.org/
3. Serilog By serilog
- Like many other libraries for .NET, Serilog provides diagnostic logging to files, the console, and elsewhere. It is easy to set up, has a clean API, and is portable between recent .NET platforms.
- Unlike other logging libraries, Serilog is built with powerful structured event data in mind.
For further details, you can visit https://serilog.net/
Common.Logging provides a basic logging abstraction for developers to code against that makes it easy to switch your application from one logging framework to the next via simple configuration.
- Common.Logging offers multiple ready-built adapters to support the most popular logging frameworks in the .NET ecosystem today.
- If your logging framework of choice isn't already supported, Common.Logging also provides a set of ready-to-use base classes that make it very low-friction to extend Common.Logging support to just about any logging framework you might need.
For further details, you can visit http://net-commons.github.io/common-logging/
5. ELMAH By raboof & james driscoll
ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment. It provides the following facilities;
- Logging of nearly all unhandled exceptions.
- A web page to remotely view the entire log of recorded exceptions.
- A web page to remotely view the full details of any one logged exception, including colored stack traces.
- In many cases, you can review the original yellow screen of death that ASP.NET generated for a given exception, even with customErrors mode turned on.
- An e-mail notification of each error at the time it occurs.
- An RSS feed of the last 15 errors from the log.
For further details, you can visit https://elmah.github.io/
6. Castle.Core By castleproject
Castle Core provides common Castle Project abstractions including logging services. It also features Castle DynamicProxy a lightweight runtime proxy generator, and Castle DictionaryAdapter.
For further details, you can visit http://www.castleproject.org/
7. EnterpriseLibrary.Logging By microsoft
The Enterprise Library Logging Application Block simplifies logging to various destinations (file, database, event log, MSMQ, etc.) and tracing.
For further details, you can visit https://msdn.microsoft.com/library/cc467894.aspx?f=255&MSPPError=-2147217396
8. Exceptionless By exceptionless
- Exceptionless provides real-time .NET error reporting for your ASP.NET, Web API, WebForms, WPF, Console, and MVC apps. It organizes the gathered information into simple, actionable data that will help your app become exceptionless.
- It is a cloud-based error reporting service that sends your exceptions to https://exceptionless.com and provides aggregated views and analytics.
For further details, you can visit https://exceptionless.com/
9. Bugsnag By martin308 >
The Bugsnag Notifier for .NET gives you instant notification of exceptions thrown from your ASP.NET MVC, WPF, Web API or other .NET applications. Any uncaught exceptions will trigger a notification to be sent to your Bugsnag project.
- Automatically report unhandled exceptions and crashes
- Report handled exceptions
- Attach user information to determine how many people are affected by a crash
- Send customized diagnostic data
For further details, you can visit https://github.com/bugsnag/bugsnag-dotnet
10. SumoLogic.Logging.NLog By latkin
Appenders for .NET logging frameworks which send data to Sumo Logic HTTP sources. Appenders are provided for the following .NET logging frameworks
For further details, you can visit https://github.com/SumoLogic/sumologic-net-appenders