Is the Microsoft Enterprise Library 5.0 Logging Application Block thread safe?

后端 未结 2 1968
生来不讨喜
生来不讨喜 2021-01-18 00:12

I have some code that will be logging using the Logging Application Block in Enterprise Library 5.0 from different threads. Is the LAB thread safe? Can I log like normal fro

2条回答
  •  心在旅途
    2021-01-18 01:00

    Enterprise Library 5.0 logging is thread safe.

    Before logging, EL checks the IsThreadSafe property of the TraceListener. If the specific TraceListener is not thread safe then it will perform a Monitor.Enter(listener); before calling the listener's TraceData method.

提交回复
热议问题