Package freenet.support

Examples of freenet.support.FileLoggerHook$IntervalParseException


      } catch (NodeNeedRestartException e) {
        // impossible
        System.err.println("impossible NodeNeedRestartException for logger.priority in config file: "
                + config.getString("priority"));
      }
      FileLoggerHook hook;
      try {
        hook =
          new FileLoggerHook(true, new File(logDir, LOG_PREFIX).getAbsolutePath(),
                "d (c, t, p): m", "MMM dd, yyyy HH:mm:ss:SSS", logRotateInterval, LogLevel.DEBUG /* filtered by chain */, false, true,
                maxZippedLogsSize /* 1GB of old compressed logfiles */, maxCachedLogLines);
      } catch (IOException e) {
        System.err.println("CANNOT START LOGGER: "+e.getMessage());
        return;
      } catch (IntervalParseException e) {
        System.err.println("INVALID LOGGING INTERVAL: "+e.getMessage());
        logRotateInterval = "5MINUTE";
        try {
          hook =
            new FileLoggerHook(true, new File(logDir, LOG_PREFIX).getAbsolutePath(),
                  "d (c, t, p): m", "MMM dd, yyyy HH:mm:ss:SSS", logRotateInterval, LogLevel.DEBUG /* filtered by chain */, false, true,
                  maxZippedLogsSize /* 1GB of old compressed logfiles */, maxCachedLogLines);
        } catch (IntervalParseException e1) {
          System.err.println("CANNOT START LOGGER: IMPOSSIBLE: "+e1.getMessage());
          return;
        } catch (IOException e1) {
          System.err.println("CANNOT START LOGGER: "+e1.getMessage());
          return;
        }
      }
      hook.setMaxListBytes(maxCachedLogBytes);
      hook.setMaxBacklogNotBusy(maxBacklogNotBusy);
      fileLoggerHook = hook;
      Logger.globalAddHook(hook);
      hook.start();
    }
  }
View Full Code Here


  }

  protected void disableLogger() {
    synchronized(enableLoggerLock) {
      if(fileLoggerHook == null) return;
      FileLoggerHook hook = fileLoggerHook;
      Logger.globalRemoveHook(hook);
      hook.close();
      fileLoggerHook = null;
      Logger.destroyChainIfEmpty();
    }
  }
View Full Code Here

TOP

Related Classes of freenet.support.FileLoggerHook$IntervalParseException

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.