如何在 Web.config 中为 SeriLog 指定 JsonFormatter? [英] How to specify JsonFormatter in Web.config for SeriLog?

查看:52
本文介绍了如何在 Web.config 中为 SeriLog 指定 JsonFormatter?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想弄清楚如何在 web.config 中为 SeriLog 指定 JsonFormatter,我也在使用滚动文件接收器,并且也在 web.config 中指定.

I am trying to figure out how to specify JsonFormatter in web.config for SeriLog, I am also using rolling file sink and that is specified in the web.config as well.

推荐答案

目前不支持使用 Serilog 在 XML 中指定自定义文本格式化程序.使用代码来执行此配置(可能基于阅读应用设置)是您今天最好的选择.

There isn't currently any support for specifying custom text formatters in XML with Serilog. Using code to perform this configuration, perhaps based on reading an app setting, is your best bet today.

这篇关于如何在 Web.config 中为 SeriLog 指定 JsonFormatter?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆