Logging fixes

Fixed logging when connection to app server has failed.