Package java.util.logging

Examples of java.util.logging.LogManager.readConfiguration()


    }
    // Load logging configuration from resources.
    String cfgfile = pkg.replace('.', File.separatorChar) + File.separatorChar + name;
    try {
      InputStream cfgdata = FileUtil.openSystemFile(cfgfile);
      logManager.readConfiguration(cfgdata);

      // also load as properties for us, to get debug flag.
      InputStream cfgdata2 = FileUtil.openSystemFile(cfgfile);
      Properties cfgprop = new Properties();
      cfgprop.load(cfgdata2);
View Full Code Here


      // Fall back to full path / resources.
      cfgfile = pkg.replace('.', File.separatorChar) + File.separatorChar + name;
    }
    try {
      InputStream cfgdata = FileUtil.openSystemFile(cfgfile);
      logManager.readConfiguration(cfgdata);

      // also load as properties for us, to get debug flag.
      InputStream cfgdata2 = FileUtil.openSystemFile(cfgfile);
      Properties cfgprop = new Properties();
      cfgprop.load(cfgdata2);
View Full Code Here

    this.logFile.delete();

    // initialize log framework
    LogManager logManager = LogManager.getLogManager();
    try {
      logManager.readConfiguration(ClassLoader.getSystemResourceAsStream(loggerPropertiesFileName));
    } catch (SecurityException e) {
      handleException(e);
      return;
    } catch (IOException e) {
      handleException(e);
View Full Code Here

        LogManager lm = LogManager.getLogManager();
        InputStream ins = JAXRSLoggingAtomPushTest.class.getResourceAsStream(propFile);
        String s = IOUtils.readStringFromStream(ins);
        ins.close();
        s = s.replaceAll("9080", PORT);
        lm.readConfiguration(new ByteArrayInputStream(s.getBytes("UTF-8")));
       
        for (Handler h : LOG.getHandlers()) {
            LOG.removeHandler(h);
            h.close();
        }
View Full Code Here

    public static void afterClass() throws Exception {
        LogManager lm = LogManager.getLogManager();
        try {
            lm.reset();
            // restoring original configuration to not use tested logging handlers
            lm.readConfiguration();
        } catch (Exception e) {
            // ignore missing config file
        }
        if (server != null) {
            server.destroy();
View Full Code Here

      props.put("java.util.logging.FileHandler.level", "ALL");
      props.put("java.util.logging.FileHandler.pattern", f.getAbsolutePath());
      props.put("java.util.logging.FileHandler.formatter", "java.util.logging.SimpleFormatter");
      props.store(buffer, null);
      buffer.close();
      manager.readConfiguration(new ByteArrayInputStream(buffer.toByteArray()));
    } else {
      manager.readConfiguration();
    }
  }
}
View Full Code Here

      props.put("java.util.logging.FileHandler.formatter", "java.util.logging.SimpleFormatter");
      props.store(buffer, null);
      buffer.close();
      manager.readConfiguration(new ByteArrayInputStream(buffer.toByteArray()));
    } else {
      manager.readConfiguration();
    }
  }
}
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.