@Override
    protected void append(ILoggingEvent loggingEvent) {
        Class<?> sourceClass;
        try {
            sourceClass = Class.forName(loggingEvent.getLoggerName());
        } catch (ClassNotFoundException e) {
            // Unable to find the class that we are logging - so just use the
            // base object as the source name.
            sourceClass = Object.class;
        }

        switch (loggingEvent.getLevel().toInt()) {
            case Level.ERROR_INT:
            case Level.WARN_INT:

                // If logging event contains details of something that has been
                // thrown - pump that into the UserMetrix logging event.
                if (loggingEvent.getThrowableProxy() != null &&
                    loggingEvent.getThrowableProxy().getClass().equals(ThrowableProxy.class)) {
                    ThrowableProxy tp = (ThrowableProxy) loggingEvent.getThrowableProxy();

                    UserMetrix.getInstance().error(loggingEvent.getMessage(),
                                                   tp.getThrowable(),
                                                   sourceClass);

                // Nothing has been thrown - just do a vanilla log event.
                } else {

                    UserMetrix.getInstance().error(loggingEvent.getMessage(),
                                                   sourceClass);
                }

                break;

            case Level.TRACE_INT:
            case Level.INFO_INT:
            case Level.DEBUG_INT:
            default:
                UserMetrix.getInstance().event(loggingEvent.getMessage(),
                                               sourceClass);
                break;
        }
    }