Package java.util.logging

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


      checkPropertyNull(manager);
      assertEquals(1, root.getHandlers().length);
      assertEquals(Level.OFF, root.getLevel());

      try {
        manager.readConfiguration();
      } catch (Exception e) {
        e.printStackTrace();
      }
      checkPropertyNull(manager);
      assertEquals(1, root.getHandlers().length);
View Full Code Here


      checkPropertyNull(manager);
      assertEquals(1, root.getHandlers().length);
      assertEquals(Level.OFF, root.getLevel());

      try {
        manager.readConfiguration();
      } catch (Exception e) {
        e.printStackTrace();
      }
      checkPropertyNull(manager);
      assertEquals(1, root.getHandlers().length);
View Full Code Here

      manager.reset();
      checkPropertyNull(manager);
      assertEquals(0, root.getHandlers().length);
      assertEquals(Level.INFO, root.getLevel());
      try {
        manager.readConfiguration();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
View Full Code Here

      p.put(".level", "OFF");
      InputStream in = null;
      try {
        in = EnvironmentHelper.PropertiesToInputStream(p);
        LogManager manager = LogManager.getLogManager();
        manager.readConfiguration(in);
      } catch (Exception e) {
        e.printStackTrace();
      } finally {
        try {
          in.close();
View Full Code Here

      final InputStream input = LoggingUtils.class.getResourceAsStream(file);
      if (input != null)
      {
        try
        {
          logManager.readConfiguration(input);
        }
        finally
        {
          IOUtil.close(input);
        }
View Full Code Here

  private void initializeLogging() {
    File homeDir = new File(System.getProperty("user.home"));
    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

    try {
      ClassLoader cl = MZmineCore.class.getClassLoader();
      InputStream loggingProperties = cl
          .getResourceAsStream("logging.properties");
      LogManager logMan = LogManager.getLogManager();
      logMan.readConfiguration(loggingProperties);
      loggingProperties.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

            System.out.println("STARTUP: Trying to load logging configuration from file " + loggingConfigFile.toString());
            fileIn = new FileInputStream(loggingConfigFile);

            // loading the logger configuration from file
            final LogManager logManager = LogManager.getLogManager();
            logManager.readConfiguration(fileIn);

            // creating the logging directory
            String logPattern = logManager.getProperty("java.util.logging.FileHandler.pattern");
            int stripPos = logPattern.lastIndexOf(File.separatorChar);
            if (!new File(logPattern).isAbsolute()) logPattern = new File(dataPath, logPattern).getAbsolutePath();
View Full Code Here

        public Object run() throws Exception {
          LogManager manager = LogManager.getLogManager();
          if ("".equals(filePath)) {
            InputStream is = getDefaultLogConfigFile();
            if (is != null) {
              manager.readConfiguration(is);
            }
          } else {
            InputStream is = null;
            if (relative) {
              is = getLogConfigFile(3, filePath);
View Full Code Here

            if (relative) {
              is = getLogConfigFile(3, filePath);
            } else {
              is = getLogConfigFile(2, filePath);
            }
            manager.readConfiguration(is);
          }
          return null;
        }
      });
      System.out.println("Completed logger config.");
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.