When comparing log4net vs Serilog, the Slant community recommends Serilog for most people. In the question“What are the best .NET logging frameworks?” Serilog is ranked 2nd while log4net is ranked 3rd.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Widely Used
Using log4net is a safe bet - many other open-source projects use it as well and it'll be just another dependency you don't have to worry about. This also means finding support to fix bugs is a lot easier!
Pro Robust
Has all the features you'll most likely need, and is quite configurable. Basically what you'd expect from a very popular and widely-used framework.
Pro Supports Multiple Frameworks
Pro Modular and Extendable
Has plugins for most of the things you'll need to get done without having to deal with too much unnecessary functionality.
Pro Can log structured data
Pro Flexible configuration options
Configuring directly or using appsettings is fairly and there are many examples available.
Pro Multiple extensions
You can easily configure it to log into Console / File / Seq / ElasticSearch / etc.
Pro Log Enricher and Log Context features
Easily and extensibly enrich your log messages with contextual information such as thread or request ID.
Pro Is portable between recent .NET platforms
Cons
Con Dealing with errors can be a pain
Because of the poor documentation and difficulty of configuration you might end up spending a lot of time just trying to fix things that aren't working.
Con Confusing Documentation
Documentation is quite difficult to navigate through unless you know exactly what you're looking for.
Con Documentation is distributed among plugins
Determining what logger, formatter, option is more difficult because documentation is associated with each component.
Alternative Products
