Fixed issue with logging messages before connection.