Microsoft Logging application block and multi-threading

前端 未结 2 1159
有刺的猬
有刺的猬 2021-01-23 05:22

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

2条回答
  •  死守一世寂寞
    2021-01-23 05:53

    I am not too sure why you are concerned that this might happen. As long as you provide a category for your logging messages those should be written to the appropriate logging file configured for that category. This operation is thread safe.

    Or are you talking about writing the logging messages of the same category to different files by thread? E.g. thread 1 -> mylog-1.log; thread 2 -> mylog-2.log

提交回复
热议问题