根据优先级监听器输出
我目前正在企业库中使用日志框架。有谁知道如何使用优先级来控制每个监听器的输出?例如,如果日志的优先级高于3,则该监听器仅将信息输出到目标。谢谢。
I am currently using the Logging framework in Enterprise Library. Does anyone know how to use Priority to control the output for each Listener? For example, this listener only output the information to the target if the Priority of the log is higher than 3. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,预定义的侦听器不支持按优先级过滤。简单的解决方案是使用严重性。
我认为您可以使用 CustomTraceListener 来按您想要的任何内容进行过滤。
As I know predefined listener doesn't support filter by priority. Simple solution is to use severity.
I think you can use CustomTraceListener to filter by whatever you want.