Fix IP address race condition for logging