根据优先级监听器输出

发布于 2025-01-05 02:14:05 字数 79 浏览 4 评论 0原文

我目前正在企业库中使用日志框架。有谁知道如何使用优先级来控制每个监听器的输出?例如,如果日志的优先级高于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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝咒 2025-01-12 02:14:05

据我所知,预定义的侦听器不支持按优先级过滤。简单的解决方案是使用严重性。
我认为您可以使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文