logger thread safety: use a lock object instead of a mutex