Serilog-将级别转换为Syslog标准
我正在使用Azure IoT Edge容器,我们正在使用Serilog。 Microsoft建议以本文所示的格式输出日志文本: https://learn.microsoft.com/en-us/azure/azure/iot-ege/iot-egge/how-to-to-to-to-to-to-regrieve-iot-iot-egge--ge----------------------- logs?view = iotedge-2020-11 。它会将这样的线输出到控制台:
< 6> 2022-06-15 13:05:44.790 +00:00 [inf] - 接收到直接方法调用 - ping
我的问题是 - 如何显示两次级别?第二个很容易({级别:u3}),但是如何在行开头将级别转换为syslog编号?数字参考是在上面文章的开头。我考虑过文本格式器,但是我需要格式的两种不同的方式,并且不确定这是否有效。
想法?
I am working on an Azure IoT Edge container and we are using Serilog. Microsoft recommends outputting the log text to the console window in the format shown in this article: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-retrieve-iot-edge-logs?view=iotedge-2020-11. It would output a line like this to the console:
<6> 2022-06-15 13:05:44.790 +00:00 [INF] - Received direct method call - ping
My question is - how can I display the level twice? The second is easy ({level:u3}), but how can I convert the level to a syslog number at the beginning of the line? The number reference is at the beginning of the article above. I thought about a text formatter, but I need the level formatted two different ways and was not sure that would work.
Thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我把它与文本形式的人一起工作
I got it to work with a TextFormatter