ilogger 相关问题


在ExceptionFilter中使用ILogger

我想在 ExceptionFilter 中使用 .NET Core Logger,如下所示: 公共类 GlobalExceptionAttribute :ExceptionFilterAttribute { 私有只读 ILogger _logger;...


如何实现ILogger的BeginScope

如何实现ILogger的BeginScope 这样我就可以提取发送到 Log 函数内 BeginScope 的值 公共密封类 MyLogger :ILogger { 公共ID一次性吗?开始范围<...


为什么 ILogger.LogError 有效但 ILogger.LogInformation 无效?

为什么当我注入 ILogger 并调用 Logger.LogInformation 时,我在 Application Insights 中看不到这一点,但当我调用 Logger.LogError 时却看到了? 这是我的代码 公共异步


NLog 在ConfigureServices 中写入日志会导致日志在整个应用程序中丢失${aspnet-request-url} 和${aspnet-mvc-action}

我使用 NLog 在我的 Web API 应用程序上写入日志(.Net 6) 我需要写入ConfigureServices 方法内的日志。 由于此时ILogger还无法使用,所以我就用这种方式来写...


© www.soinside.com 2019 - 2024. All rights reserved.