跨应用程序域的 log4net

编程入门 行业动态 更新时间:2024-10-25 04:23:04
本文介绍了跨应用程序域的 log4net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个应用程序,它从一个应用程序域初始化 log4net,并需要在另一个应用程序域中使用它.是否支持?

I have an application which initializes log4net from one appdomain and needs to use it in another appdomain. Is it supported?

如果不是,我应该从每个应用程序域初始化 log4net 吗?在同一个应用程序中多次初始化是否存在风险?我应该使用相同的 log4net.config 吗?

If not, should I initialize log4net from each appdomain? Is there a risk in multiple initializations in the same application? Should I use the same log4net.config?

推荐答案

log4net-user 邮件列表有一个适用于 RollingFileAppender 的答案.将以下行添加到 log4net.config 中的 appender:

The log4net-user mailing list has an answer that works with RollingFileAppender. Add the following line to the appender in log4net.config:

<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />

这篇关于跨应用程序域的 log4net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-17 21:53:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/922685.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   log4net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!