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.
相关问题
- I want to trace logs using a Macro multi parameter
- Error message 'No handlers could be found for
- convert logback.xml to log4j.properties
- Django management command doesn't show logging
- apache modules ap_log_perror is at a different lev
相关文章
- how do I log requests and responses for debugging
- Android Studio doesn't display logs by package
- Stacktrace does not print in Glassfish 4.1 Cluster
- Out of curiosity — why don't logging APIs impl
- Laravel log file based on date
- Java -How to get logger to work in shutdown hook?
- Codeigniter not logging
- Is there any way to remove the information line fr
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
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.