Is Microsoft Enterprise Library 5.0 application block thread safe?

I have code that will be logged using the logging application block in Enterprise Library 5.0 from different threads. Is the LAB ceiling safe? Can I log in as normal from different threads or do I need to synchronize the logging code so that it is used from only one thread at a time?

+7
thread-safety logging enterprise-library
source share
2 answers

Enterprise Library 5.0 logs are thread safe.

Before registering, EL checks the IsThreadSafe property for TraceListener . If a specific TraceListener is not thread safe, it will execute Monitor.Enter(listener); before calling the TraceData listener TraceData .

+8
source share

As far as I know, Enterprise Library 3.1 Logging is not thread safe. There is no lock in LogWriter in the GetAvailableTraceListeners (IList traceListeners) class that used statics in the Logger class.

0
source share

All Articles