private void logFailure(AuthenticationFailureEvent event) {

        AuthenticationProvider authProvider = event.getAuthenticationProvider();

        Credentials creds = event.getCredentials();
        String username = creds.getUsername();

        if (creds.isEmpty())
            logger.debug("Empty authentication attempt (login screen "
                    + "initialization) from {} failed: {}",
                    new RemoteAddress(creds), new Failure(event));
        else if (username == null || username.isEmpty())
            logger.debug("Anonymous authentication attempt from {} failed: {}",
                    new RemoteAddress(creds), new Failure(event));
        else if (event.getFailure() instanceof GuacamoleInsufficientCredentialsException) {
            if (authProvider != null)
                logger.debug("Authentication attempt from {} for user \"{}\" "
                        + "requires additional credentials to continue: {} "
                        + "(requested by \"{}\")", new RemoteAddress(creds),
                        username, new Failure(event), authProvider.getIdentifier());
            else
                logger.debug("Authentication attempt from {} for user \"{}\" "
                        + "requires additional credentials to continue: {}",
                        new RemoteAddress(creds), username, new Failure(event));
        }
        else {
            if (authProvider != null)
                logger.warn("Authentication attempt from {} for user \"{}\" "
                        + "failed: {} (rejected by \"{}\")", new RemoteAddress(creds),
                        username, new Failure(event), authProvider.getIdentifier());
            else
                logger.warn("Authentication attempt from {} for user \"{}\" "
                        + "failed: {}", new RemoteAddress(creds), username,
                        new Failure(event));
        }

    }
Logs that authentication failed for a user.

@param event
    The event describing the authentication attempt that failed.
guacamole/src/main/java/org/apache/guacamole/event/EventLoggingListener.java