class Log4jAuditor implements Auditor {

    @SuppressWarnings("unchecked")
    public void audit(AuditEvent event) {
        initFromMDC(event);

        // create the logging event from audit event
        LoggingEvent loggingEvent = new LoggingEvent(log.getName(), log, Level.DEBUG, event.getAction(), null);
        loggingEvent.setProperty("username", event.getUsername());
        loggingEvent.setProperty("session", event.getSession());
        loggingEvent.setProperty("ip", event.getIp());

        // add the logging event to all appenders
        Enumeration<Appender> en = log.getAllAppenders();
        while (en.hasMoreElements()) {
            en.nextElement().doAppend(loggingEvent);
        }
    }

    public  Log4jAuditor();
    public  Log4jAuditor(String loggerName);

}