Ejemplo n.º 1
0
  private void configure() {

    bufferSize = manager.getProperty(LogConstants.BUFFER_SIZE);
    if (bufferSize != null && bufferSize.length() > 0) {
      try {
        recCountLimit = Integer.parseInt(bufferSize);
      } catch (NumberFormatException e) {
        recCountLimit = 1;
      }
    } else {
      recCountLimit = 1;
    }

    String status = manager.getProperty(LogConstants.TIME_BUFFERING_STATUS);

    if (status != null && status.equalsIgnoreCase("ON")) {
      timeBufferingEnabled = true;
    }

    setLevel(Level.ALL);
    setFilter(null);

    String urlString = manager.getProperty(LogConstants.LOGGING_SERVICE_URL);
    try {
      logServURL = new URL(urlString);
    } catch (MalformedURLException mue) {
      if (Debug.warningEnabled()) {
        Debug.warning(
            "RemoteHandler.getLogHostURL(): '" + urlString + "' is malformed. " + mue.getMessage());
      }
    }
  }
Ejemplo n.º 2
0
 private void startTimeBufferingThread() {
   String period = manager.getProperty(LogConstants.BUFFER_TIME);
   long interval;
   if ((period != null) || (period.length() != 0)) {
     interval = Long.parseLong(period);
   } else {
     interval = LogConstants.BUFFER_TIME_DEFAULT;
   }
   interval *= 1000;
   if (bufferTask == null) {
     bufferTask = new TimeBufferingTask(interval);
     try {
       SystemTimer.getTimer()
           .schedule(
               bufferTask, new Date(((System.currentTimeMillis() + interval) / 1000) * 1000));
     } catch (IllegalArgumentException e) {
       Debug.error(logName + ":RemoteHandler:BuffTimeArg: " + e.getMessage());
     } catch (IllegalStateException e) {
       if (Debug.messageEnabled()) {
         Debug.message(logName + ":RemoteHandler:BuffTimeState: " + e.getMessage());
       }
     }
     if (Debug.messageEnabled()) {
       Debug.message("RemoteHandler: Time Buffering Thread Started");
     }
   }
 }
Ejemplo n.º 3
0
  static {
    lmanager = (LogManager) LogManagerUtil.getLogManager();
    String voutClass = lmanager.getProperty(LogConstants.VERIFIER_ACTION_CLASS);
    try {

      Class c = Class.forName(voutClass);
      vout = (IVerifierOutput) c.newInstance();
    } catch (Exception e) {
      Debug.error("Authorizer : Exception : ", e);
    }
  }