Package java.util.logging

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


      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


      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

            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

        final ClassLoader cl = getClass().getClassLoader();
        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run () {
                try {
                    InputStream config = cl.getResourceAsStream(PROPERIES_FILE);
                    logManager.readConfiguration(config);
                    return null;
                }
                catch (IOException ex) {
                    throw new RuntimeException(
                        msg.msg("EXC_LoggerSetupIOException", //NOI18N
View Full Code Here

      // Try the current class loader if system one cannot find the file
      if (ins == null) {
      ins = this.getClass().getClassLoader().getResourceAsStream(loggerPropertiesFileName);
      }
      if (ins != null) {
      logManager.readConfiguration(ins);
      } else {
      System.out.println("WARNING: failed to load "+loggerPropertiesFileName);
      }
    } catch (SecurityException e) {
      handleException(e);
View Full Code Here

  public void testConvertToMetaModelException() throws Exception {
    LogManager logManager = LogManager.getLogManager();
    File logConfigFile = new File("src/test/resources/logconfig.txt");
    assertTrue(logConfigFile.exists());
    logManager.readConfiguration(new FileInputStream(logConfigFile));

    assertTrue(JdbcUtils.wrapException(new SQLException("msg"), "foo") instanceof MetaModelException);
    assertTrue(JdbcUtils.wrapException(
        new SQLException("msg", "sql state"), "foo") instanceof MetaModelException);
    assertTrue(JdbcUtils.wrapException(new SQLException("msg", "sql state",
View Full Code Here

        if (fname != null && new File(fname).exists())
        {
            try
            {
                // default configuration reader will examine the property and load configuration
                lm.readConfiguration();
                inited = true;
            } catch (IOException e)
            {
                System.err.println(Strings.error("logging.using.overriden.configuration.errored"));
                e.printStackTrace();
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.