Log4Net FileAppender线程不安全吗? [英] Log4Net FileAppender not thread safe?

查看:101
本文介绍了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本身

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线程不安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆