Is ASP.NET Core native logging more secure for NLog / Serilog / etc?

We use NLog or Serilog for logging. We are busy porting the system from ASP.NET to the ASP.NET kernel, which has a built-in log .

Ideally, we would like to abandon NLog, as it is no longer required.

However, a built-in protocol equivalent to NLog? Are there any missing core features? Does it make sense to continue using NLog (or something like Serilog for example)?

+5
source share
2 answers

Registration asp.net is a common (logging) interface and protocol implementation.

You can use a common interface and a third-party library (for example, NLog) together, since the infrastructure is prepared for this.

If you charge NLog for the built-in logging implementation, you win:

  • on-the-fly configuration change (when starting the application without rebooting)
  • more goals (e.g. database, file). There is no built-in built-in target: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging . The mail target in NLog is not yet set to netstandard, but it is planned.
  • additional parameters in the targets (for example, file archiving)
  • Record additional context information, for example ${processid}
  • since we invest a lot in performance optimization, I would expect performance.
  • asynchronous logging - which is not known in the asp.net protocol, as far as I know.
  • advanced features such as buffering, backing up and restricting your logs, filtering conditions with context information, recording simultaneously with one file, etc.
  • NLog is easier to expand (not only target, but also renderings of layouts, layouts, etc.).
  • structural logging capability (Serilog, NLog 4.5)

But, as always, if you do not need these functions, perhaps fewer (libraries) more.

+5
source

I would not say that the ASP.NET Core logging API makes NLog and other vendors obsolete. The ASP.NET Core provides excellent abstraction, so logging frameworks can switch without changing the code, which depends on logging.

Nlog still provides useful configuration options that are not implemented in the Core.NET Logging API.

+5
source

Source: https://habr.com/ru/post/1261906/


All Articles