Examples of SimpleFormatter


Examples of java.util.logging.SimpleFormatter

      try {
          logger = Logger.getLogger("General");
          fh = new FileHandler("c:\\temp\\poker\\sss.log", true);
          logger.addHandler(fh);
          logger.setLevel(Level.ALL);
          SimpleFormatter formatter = new SimpleFormatter();
                fh.setFormatter(formatter);
            } catch (IOException e) {
            }
  }
View Full Code Here

Examples of java.util.logging.SimpleFormatter

   * net.sourceforge.log.hierarchical.HierarchyFileHandler.path
   * net.sourceforge.log.hierarchical.HierarchyFileHandler.delimiter
   */
  public HierarchyFileHandler() {
    fileManager = new HierarchyFileManager();
    setFormatter(new SimpleFormatter());
    configure();
  }
View Full Code Here

Examples of java.util.logging.SimpleFormatter

    setPath(helper.getStringProperty(className + ".path", "./logs/${date}"));
    // ".pattern" "%h/java%u.log"
    setDelimiter(helper.getStringProperty(className + ".delimiter", "|||"));
    setLevel(helper.getLevelProperty(className + ".level", Level.ALL));
    setFilter(helper.getFilterProperty(className + ".filter", null));
    setFormatter(helper.getFormatterProperty(className + ".formatter", new SimpleFormatter()));
    try {
      setEncoding(manager.getProperty(className + ".encoding"));
    } catch (Exception ex) {
      try {
        setEncoding(null);
View Full Code Here

Examples of java.util.logging.SimpleFormatter

    public void testGetLogRecord() {
        testing = Errors.getResources(Locale.ENGLISH);
        final LogRecord record = testing.getLogRecord(Level.FINE, Errors.Keys.NullArgument_1, "CRS");
        assertEquals("NullArgument_1", record.getMessage());

        final SimpleFormatter formatter = new SimpleFormatter();
        final String message = formatter.format(record);
        assertTrue(message.contains("Argument ‘CRS’ shall not be null."));
        testing = null;
    }
View Full Code Here

Examples of java.util.logging.SimpleFormatter

      Logger logger = Logger.getLogger(PGETaskInstance.class.getName()
            + "." + workflowInstId);
      FileHandler handler = new FileHandler(
            new File(logDir, createLogFileName()).getAbsolutePath());
      handler.setFormatter(new SimpleFormatter());
      logger.addHandler(handler);
      return logger;
   }
View Full Code Here

Examples of java.util.logging.SimpleFormatter

                setFormatter((Formatter) cl.loadClass(formatterName).newInstance());
            } catch (Exception e) {
                // Ignore
            }
        } else {
            setFormatter(new SimpleFormatter());
        }
       
        // Set error manager
        setErrorManager(new ErrorManager());
       
View Full Code Here

Examples of java.util.logging.SimpleFormatter

                setFormatter((Formatter) cl.loadClass(formatterName).newInstance());
            } catch (Exception e) {
                // Ignore
            }
        } else {
            setFormatter(new SimpleFormatter());
        }
       
        // Set error manager
        setErrorManager(new ErrorManager());
       
View Full Code Here

Examples of java.util.logging.SimpleFormatter

    if (logFilePattern != null) {
      LOG.log(Level.INFO, "Creating Log Handler to capture pge output to file '"
              + logFilePattern + "'");
      new File(logFilePattern).getParentFile().mkdirs();
      handler = new FileHandler(logFilePattern);
      handler.setFormatter(new SimpleFormatter());

    }
    return handler;
  }
View Full Code Here

Examples of java.util.logging.SimpleFormatter

  /*
   * Test getFormatter & setFormatter methods with non-null value.
   */
  public void testGetSetFormatter_Normal() throws Exception {
    MockHandler h = new MockHandler();
    Formatter f = new SimpleFormatter();
    h.setFormatter(f);
    assertSame(f, h.getFormatter());
  }
View Full Code Here

Examples of java.util.logging.SimpleFormatter

    } catch (NullPointerException e) {
    }

    // test reset null
    try {
      h.setFormatter(new SimpleFormatter());
      h.setFormatter(null);
      fail("Should throw NullPointerException!");
    } catch (NullPointerException e) {
    }
  }
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.