Added logging to authentication mechanism