Package java.util.logging

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


      }
      try {
         InputStream in = url.openStream();

         LogManager logManager = LogManager.getLogManager();
         logManager.readConfiguration(in);
         in.close();

         // init from command line (or xmlBlaster.properties)
         synchronized (Global.class) {
            if (!logIsInitialized) {
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

            if (haveLoadedOurDefault || isDefaultJdkConfig()) {
                haveLoadedOurDefault = true;
                consoleHandler.setFormatter(
                        new BasicTextJdkLogFormatter(false));
                consoleHandler.setLevel(Level.INFO);
                lm.readConfiguration(
                        FrameworkLogger.class.getResourceAsStream(
                        "/org/hsqldb/resources/jdklogging-default.properties"));
                Logger cmdlineLogger = Logger.getLogger("org.hsqldb.cmdline");
                cmdlineLogger.addHandler(consoleHandler);
                cmdlineLogger.setUseParentHandlers(false);
View Full Code Here

                cmdlineLogger.addHandler(consoleHandler);
                cmdlineLogger.setUseParentHandlers(false);
            } else {
                // Do not intervene.  Use JDK logging exactly as configured by
                // user.
                lm.readConfiguration();
                // The only bad thing about doing this is that if the app has
                // programmatically changed the logging config after starting
                // the program but before using FrameworkLogger, we will
                // clobber those customizations.
            }
View Full Code Here

    public LogControl(Class refClass, String loggingProperties) {
        LogManager logManager = LogManager.getLogManager();
        InputStream in = refClass.getResourceAsStream(loggingProperties);
//        System.out.println("************************ LOADING LOG config from "+in);
        try {
            logManager.readConfiguration(in);
        } catch(IOException e) {
            e.printStackTrace();
        }
    }

View Full Code Here

      // Configure java.util.logging and get a Logger instance
      System
          .setProperty("java.util.logging.config.file",
              PROPERTIES_FILE);
      LogManager logManager = LogManager.getLogManager();
      logManager.readConfiguration();
      logger = Logger.getLogger("");

      // Read the properties configuration
      reader = new FileReader(PROPERTIES_FILE);
      properties = new Properties();
View Full Code Here

      // Configure java.util.logging and get a Logger instance
      System
          .setProperty("java.util.logging.config.file",
              PROPERTIES_FILE);
      LogManager logManager = LogManager.getLogManager();
      logManager.readConfiguration();
      logger = Logger.getLogger("");

      // Read the properties configuration
      reader = new FileReader(PROPERTIES_FILE);
      Client.properties = new Properties();
View Full Code Here

   
    System.setProperty("java.util.logging.config.file", PROPERTIES_FILE);
    LogManager logManager = LogManager.getLogManager();
    try
    {
      logManager.readConfiguration();
    }
    catch (IOException e){}
    logger = Logger.getLogger("");   
    textarea = new JTextArea();
    textarea.setLineWrap(true);
View Full Code Here

            props.put("testConfigClass.foo.level", "OFF");
            props.put("testConfigClass.foo.handlers", "java.util.logging.ConsoleHandler");       
            props.put(".level", "FINEST");
            props.remove("handlers");
            InputStream in = EnvironmentHelper.PropertiesToInputStream(props);
            man.readConfiguration(in);
        }
    }
   
  public static class MockInvalidInitClass {
    public MockInvalidInitClass() {
View Full Code Here

      checkPropertyNull(manager);
      assertEquals(0, root.getHandlers().length);
      assertEquals(Level.INFO, root.getLevel());

      try {
        manager.readConfiguration();
      } catch (Exception e) {
        e.printStackTrace();
      }
      checkProperty(manager);
      assertNull(root.getHandlers()[0].getLevel());
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.