.NET 下的 Log4 是不是线程安全的?

夏至如沫 发布于 2014/06/06 19:22
阅读 1K+
收藏 0
log4 模块大家是不是都在用呀?今天一个并行多线程的模块在LOG的时候挂掉了,因为都是向同一个日志文件写入操作记录的。不知道是不是LOG4不能共享日志为文件呀?如果是这样的话,那不是要纠结了,得单独为这个模块自己造个线程安全的日志类了,或者哪位大神已经有现成的了,让俺改吧改吧用上吧
加载中
0
大王叫我来卖萌
大王叫我来卖萌
  • log4net is optimized for speed.
  • log4net is based on a named logger hierarchy.
  • log4net is fail-stop but not reliable.
  • log4net is thread-safe.
  • log4net is not restricted to a predefined set of facilities.
  • Logging behavior can be set at runtime using a configuration file. Configuration files are in XML format.
  • log4net is designed to handle exceptions from the start.
  • log4net can direct its output to many sinks including: a file, the console, the NT EventLog or even e-mail.
  • log4net categorizes logging into levels: DEBUG, INFO, WARN, ERROR and FATAL.
  • The format of the log output can be easily changed by implementing a new layout class.
  • The target of the log output as well as the writing strategy can be altered by writing a new appender class.
  • log4net supports multiple output appenders per logger.
0
大王叫我来卖萌
大王叫我来卖萌
log4net is thread- safe.
0
夏至如沫
夏至如沫
好吧,领教了。。结贴,找BUG
返回顶部
顶部