Examples of FileHandler


Examples of java.util.logging.FileHandler

        params.remove(arg);
       
        System.setProperty(IHttpExchange.SHOW_DETAILED_ERROR_KEY, "true");

       
        FileHandler fh = new FileHandler("proxy.log", 500000, 2);
        fh.setLevel(Level.FINE);
        fh.setFormatter(new LogFormatter());

       
        ConsoleHandler ch = new ConsoleHandler();
        ch.setLevel(Level.FINE);
        ch.setFormatter(new LogFormatter());
View Full Code Here

Examples of java.util.logging.FileHandler

            final Logger logger = Logger.getLogger("");
            logger.setUseParentHandlers(false);

            //for (Handler h: logger.getHandlers()) logger.removeHandler(h);
            if (!dataPath.getAbsolutePath().equals(appPath.getAbsolutePath())) {
                final FileHandler handler = new FileHandler(logPattern, 1024*1024, 20, true);
                logger.addHandler(handler);
            }

            // redirect uncaught exceptions to logging
            final Log exceptionLog = new Log("UNCAUGHT-EXCEPTION");
View Full Code Here

Examples of java.util.logging.FileHandler

        params.remove(arg);
       
        System.setProperty(IHttpExchange.SHOW_DETAILED_ERROR_KEY, "true");

       
        FileHandler fh = new FileHandler("proxy.log", 500000, 2);
        fh.setLevel(Level.FINE);
        fh.setFormatter(new LogFormatter());

       
        ConsoleHandler ch = new ConsoleHandler();
        ch.setLevel(Level.FINE);
        ch.setFormatter(new LogFormatter());
View Full Code Here

Examples of java.util.logging.FileHandler

    next.add(Calendar.DATE, 1);
    _endDate = next.getTimeInMillis();

    try
    {
      _handler = new FileHandler(pattern, _limit, _count, _append);
      if (_init)
      {
        _handler.setEncoding(this.getEncoding());
        _handler.setErrorManager(this.getErrorManager());
        _handler.setFilter(this.getFilter());
View Full Code Here

Examples of java.util.logging.FileHandler

    {
      String rollMode = _config.getString("wrapper.logfile.rollmode", "");
      boolean append = !(rollMode.contains("WRAPPER") || rollMode.contains("JVM"));
      int count = _config.getInt("wrapper.logfile.maxfiles", 1);
      int limit = getLogLimit();
      _fileHandler = fileName.contains("%d") ? new DateFileHandler(fileName, limit, count, append) : new FileHandler(fileName, limit, count,
          append);
      _fileHandler.setFormatter(getFileFormatter());
      _fileHandler.setLevel(getLogLevel(fileLogLevel));
    }
    catch (Exception e)
View Full Code Here

Examples of java.util.logging.FileHandler

  static public void logger() {
    // Create Logger
    try{
    Logger logger = Logger.getLogger("");
    logger.setLevel(Level.INFO);
    txtFile = new FileHandler("Logging.txt",true);
   
    // Create txt Formatter
    formatterTxt = new SimpleFormatter();
    txtFile.setFormatter(formatterTxt);
    logger.addHandler(txtFile);
View Full Code Here

Examples of java.util.logging.FileHandler

    // Get own log file
    try {
      // Create an appending file handler
      new File(this.getDataFolder() + "/temp/").mkdir();
      FileHandler handler = new FileHandler(this.getDataFolder() + "/temp/war.log", true);

      // Add to War-specific logger
      Formatter formatter = new WarLogFormatter();
      handler.setFormatter(formatter);
      this.getLogger().addHandler(handler);
    } catch (IOException e) {
      this.getLogger().log(Level.WARNING, "Failed to create War log file");
    }
   
View Full Code Here

Examples of java.util.logging.FileHandler

     */
  public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {
            ESeq argv = process_args(args);
            maybe_print_banner();

      Handler fh = new FileHandler("erjang.log");
      Logger.getLogger("").addHandler(fh);
     // Logger.getLogger("erjang").setLevel(Level.FINE);
      // Logger.getLogger("kilim.Task").setLevel(Level.FINEST);

    load_modules_and_drivers(Arrays.asList(MODULES), Arrays.asList(DRIVERS));
View Full Code Here

Examples of java.util.logging.FileHandler

    LogManager manager = LogManager.getLogManager();
    String pattern = manager.getProperty(ErrorTriggeredFileHandler.class.getName() + ".pattern");
    if (pattern == null) {
      pattern = DEFAULT_PATTERN;
    }
    return new FileHandler(pattern);
  }
View Full Code Here

Examples of java.util.logging.FileHandler

     * @throws SecurityException
     * @throws IOException
     */
    public MasterLoggingHandler(final String root, Level level) throws SecurityException,
                                                               IOException {
        this.fileHandler = new FileHandler(root + "/java.logging.bsfree.txt");

        //this.fh2.setFormatter(new SimpleFormatter());
        this.fileHandler.setFormatter(new SimpleAndWhatIWouldHaveLikedFormatter());

        // The output should appear in the files
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.