Microsoft日志记录应用程序块和多线程 [英] Microsoft Logging application block and multi-threading

查看:60
本文介绍了Microsoft日志记录应用程序块和多线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Logging应用程序块(4.1)的新手. 是否有人编写过使用多个线程中的Logging应用程序块的应用程序?我之所以问是因为Logger是静态类,并且因为可能从多个线程写入同一日志文件.

I am new to the Logging application block (4.1). Has anyone written an application that uses the Logging application block from multiple threads? I am asking because the Logger is a static class and because of potential writing to the same log file from multiple threads for example.

推荐答案

日志记录应用程序块"是线程安全的,这意味着您可以从多个线程中调用其公共方法,而无需自己进行任何同步.该库执行自己的同步.

The Logging Application Block is thread safe, meaning you can call its public methods from multiple threads without doing any synchronization of your own. The library does its own synchronization.

这篇关于Microsoft日志记录应用程序块和多线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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