Does ASP.NET Core's built-in logging make NLog/Serilog/etc obsolete?

The ASP.NET logging is a common (logging) interface and log implementation.

You could use the common interface and 3rd party library (e.g NLog) together as the infrastructure is prepared for that.

If you take NLog over the built-in logging implementation you win:

  • changing configuration on-the-fly (while running application without restart)
  • more targets (e.g. database, file). There is no file target in the built-in: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging. The mail target in NLog isn't in .NET Standard yet, but it's planned. The mail target is there for .NET Standard 2 and for .NET Standard 1 there is NLog.MailKit
  • more options in targets (e.g. file archiving)
  • writing extra context info, like ${processid}
  • as we invest a lot of in performance optimization, I would expect performance.
  • async logging - which isn't in ASP.NET logging as far as I know.
  • advanced features like buffering, fallbacks & limiting your logs, filter conditions with context info, writing concurrent to one file etc.
  • NLog is easier to extend (not only targets but also layout renderers, layouts etc.)
  • possibility for structural logging (Serilog, NLog 4.5)

But as always, if you don't need these features then maybe less (libraries) is more.


I wouldn't say that ASP.NET Core's logging API makes NLog and other providers obsolete. What ASP.NET Core provides is a nice abstraction so logging frameworks can be switched without changing code that depends on logging.

Nlog still provides useful configuration features that are not implemented in ASP.NET Core logging API.