Examples of readConfiguration()


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

      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

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

            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

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

        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

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

      // 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

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

  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

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

        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

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

        {
            final InputStream url =
                this.getClass().getClassLoader().getResourceAsStream(RESOURCE_LOGGING_PROPERTIES);
            try
            {
                lm.readConfiguration(url);
            } catch (IOException e)
            {
                System.err.println(Strings.error("logging.unable.to.use.production.configuration"));
                e.printStackTrace();
            }
View Full Code Here

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

                consoleHandler.setFormatter(
                    new BasicTextJdkLogFormatter(false));
                consoleHandler.setLevel(Level.INFO);
                istream = FrameworkLogger.class.getResourceAsStream(path);
                lm.readConfiguration(istream);

                Logger cmdlineLogger = Logger.getLogger("org.hsqldb.cmdline");

                cmdlineLogger.addHandler(consoleHandler);
                cmdlineLogger.setUseParentHandlers(false);
View Full Code Here

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

                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

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

        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")));
    }

    private static void logSixEvents(Logger log) {
        log.severe("severe message");
        log.warning("warning message");
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.