I’m using log4cxx::rolling::RollingFileAppender() for logging in my C++ application, without any asynchronous appenders. If I invoke logging from the main thread, will the main thread be blocked until the log string is written to the log file? Moreover, what would be the most reliable method to confirm this behavior?
If I incorporate asynchronous appenders, would it potentially disrupt the logging order or introduce unexpected delays in a multithreaded scenario? I’m particularly concerned about the impact on logging consistency and performance. Can someone offer insights into how asynchronous logging behaves under these circumstances?
I have experienced a critical thread delay on one of the message receiving thread, logger logged the expected log line after 1 second delay as follows.
Here log line “2024-04-03 22:55:14,237 [0x00003c5c]” is logged after “2024-04-03 22:55:15,237 [0x00004a44]” also the timestamp is getting fetched by log4cxx only, so here based on other message processing delays I’m suspecting logger got stuck and blocked the calling thread.