Package ch.qos.logback.audit

Examples of ch.qos.logback.audit.AuditException


        }
      } catch (IOException e) {
        oos = null;
        this.started = false;
        fireConnector();
        throw new AuditException("Failed sending audit event to host \""
            + remoteHost + "\" down. For more information, please visit "
            + FAILIED_WRITE_URL, e);
      }
    }

    try {
      Object incoming = ois.readObject();
      if (incoming instanceof Exception) {
        if (incoming instanceof AuditException) {
          AuditException ae = (AuditException) incoming;
          throw ae;
        } else {
          throw new AuditException("Server incurred an exception",
              (Exception) incoming);
        }
      } else if (incoming instanceof Boolean) {
        Boolean ack = (Boolean) incoming;
        if (ack.booleanValue()) {
          // System.out.println("ACKED");
        } else {
          throw new AuditException("Acknowledgement failure");
        }
      } else {
        throw new AuditException("Incoming object [" + incoming
            + "] outside of protocol");
      }
    } catch (IOException e) {
      throw new AuditException("Failed reading acknowledgement", e);
    } catch (ClassNotFoundException e) {
      throw new AuditException("Unexpecteed object type while acknowledgement",
          e);
    }
  }
View Full Code Here


      throws AuditException {

    try {

      if (!this.started) {
        throw new AuditException(
            "Attempted to append to non started appender [" + name + "].");
      }

      // ok, we now invoke derived class' implementation of append
      this.append(auditEvent);

    } catch (Exception e) {
      if (e instanceof AuditException) {
        throw (AuditException) e;
      } else {
        throw new AuditException("Failed to audit an event", e);
      }
    }
  }
View Full Code Here

    if (checker.getHighestLevel(0) > Status.INFO) {
      StatusPrinter.print(sm);
    }
   
    if (auditor.getClientApplication() == null) {
      throw new AuditException("Client application has not been set");
    }
   
    if (auditor.getAuditAppender() == null) {
      throw new AuditException("No audit appender. Please see "
          + NULL_AUDIT_APPENDER_URL);
    }
  }
View Full Code Here

    configurator.setContext(auditor);

    try {
      configurator.doConfigure(url);
    } catch (JoranException e) {
      throw new AuditException("Configuration failure in " + url, e);
    }

  }
View Full Code Here

      } else {
        errMsg = "Failed to find logback-audit configuration files  ["
            + pathPrefix + TEST_AUTOCONFIG_FILE + "] or [" + pathPrefix
            + AUTOCONFIG_FILE + "].";
      }
      throw new AuditException(errMsg);
    }
  }
View Full Code Here

 
  public void log(AuditEvent auditEvent) throws AuditException {
    int writes = aai.appendLoopOnAppenders(auditEvent);
    // No appenders in hierarchy
    if (writes == 0) {
      throw new AuditException("no appender defined");
    }
  }
View Full Code Here

TOP

Related Classes of ch.qos.logback.audit.AuditException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.