Updated to use a thread-local variable for dummy log entries to avoid potential issues