c# - Unit test for Serilog write to console
问题描述
Application is in .net framework and using Serilog for logging.
Configuration
Logger = new LoggerConfiguration()
.Enrich.FromLogContext()
.MinimumLevel.Debug()
.WriteTo.Console()
.CreateLogger()
In Unit test how to verify that logger has the values which is expected to be?
Is there any way to read the values using any of Serilog api/methods?
解决方案
推荐阅读
- redis - 什么是 Redis 改变自己的配置
- c# - 如何在每个循环中的 jQuery 中使用自动完成功能?
- android - 如何通过“\n\n”Android分割文本?
- javascript - Javascript - 单击时显示带有图像的文本
- rust - libgcc 和 Rust 系统库中 `__udivti3' 的多重定义
- java - RxJava,等待多个 Observables 同时提供所需的结果
- r - 如何在 R 中使用 ifelse 语句创建粘贴链
- android - 在 Android 中使用 Google 地图访问用户的当前位置时应用程序崩溃
- python - 使用 scipy.integrate.quad、最小化和导数时出现多个溢出警告
- c# - c#垃圾收集不起作用.netframework 4及更高版本