Asp.Net 5 (core) RC1: How to log to file (rolling file logging) [DNX Core 5 compatible solution]?

后端 未结 2 1199
春和景丽
春和景丽 2021-01-18 06:50

How can I log to file in Asp.Net 5 RC1? I couldn\'t find any solution with Microsoft.Extensions.Logging. Is there any solution which is compatible with .Net Core 5 (DNX Core

2条回答
  •  庸人自扰
    2021-01-18 07:07

    Serilog.Extensions.Logging.File package is an easy way to add file logging to ASP.Net Core application (.NET Core 2.0 is supported in the latest version, which is pre-release at the moment).

    • Plugs in as ASP.NET Core logging provider
    • Provides a subset of Serilog functionality, specifically for logging to the file system.
    • Automatically pulls other Serilog packages as needed.

    https://github.com/serilog/serilog-extensions-logging-file

    https://www.nuget.org/packages/Serilog.Extensions.Logging.File

提交回复
热议问题