本文介绍了Log4Net FileAppender线程不安全吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要登录到文件,因为客户没有可以使用log4net登录的控制台.现在,我了解到FileAppender不是线程安全的.无论如何,有没有一种方法可以记录到退出不同线程的应用程序中的文件,或者是常见的替代方法?

I need to log to a file because the customer doesn't have a console of something where I can log to with log4net.Now I read that the FileAppender is not thread safe. Is there anyhow a way to log to file within an app that logs out of different threads or what would be a common alternative?

推荐答案

Log4Net本身FileAppender,noreferrer>也是线程安全的-该框架为您管理一切.只要您以正常方式登录(而不是直接写入附加程序),就可以了.

Log4Net itself is thread-safe even if FileAppender isn't - the framework manages everything for you. So long as you log in the normal way (rather than directly writing to the appender) you should be fine.

这篇关于Log4Net FileAppender线程不安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 19:43
查看更多