connection to the server with logging