Package java.util.logging

Examples of java.util.logging.Logger$DefaultHandler


   *
   */
    private static final long serialVersionUID = -5448989386458342771L;

    public String call() throws Exception {
        Logger LOG = Logger.getLogger(SelfRegisteringRemote.class.getName());

        Logger.getLogger("org").setLevel(Level.ALL);

        LOG.fine("instances " + PropertyUtils.getProperty(SeleniumConstants.PROPERTY_INSTANCE));
        SelfRegisteringRemote srr = PropertyUtils.getProperty(SeleniumConstants.PROPERTY_INSTANCE);
        String url = getRemoteURL(srr);
        srr.stopRemoteServer();

        Channel.current().setProperty(SeleniumConstants.PROPERTY_LOCK, new Object());
View Full Code Here


        }
    }

    private static void configureLogging() {
        ConsoleHandler handler = new ConsoleHandler();
        Logger root = Logger.getLogger("");
        root.addHandler(handler);
        handler.setLevel(Level.FINER);
        root.setLevel(Level.FINER);
    }
View Full Code Here

        }
    }

    private static void configureLogging() {
        ConsoleHandler handler = new ConsoleHandler();
        Logger root = Logger.getLogger("");
        root.addHandler(handler);
        // handler.setLevel(Level.FINER);
        // root.setLevel(Level.FINER);
    }
View Full Code Here

            }
        };

        SQLContainer container = new SQLContainer(new FreeformQuery(
                "SELECT * FROM people", connectionPool, "ID"));
        Logger logger = Logger.getLogger(SQLContainer.class.getName());

        logger.addHandler(ensureNoLogging);
        try {
            Assert.assertFalse(container.containsId(new Object()));
        } finally {
            logger.removeHandler(ensureNoLogging);
        }
    }
View Full Code Here

             * Create the ClientNamingConfigurator used by naming.
             */
            ClientNamingConfigurator cnc = new ClientNamingConfiguratorImpl();
            config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(cnc));
           
            Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
            AbstractActiveDescriptor<Logger> di = BuilderHelper.createConstantDescriptor(logger);
            di.addContractType(Logger.class);
            config.addActiveDescriptor(di);
           
            config.commit();
View Full Code Here

                    throw new IllegalArgumentException("Invalid number of arguments");
            }

            Enumeration en = LogManager.getLogManager().getLoggerNames();
            while (en.hasMoreElements()) {
                Logger aLogger = LogManager.getLogManager().getLogger((String) en.nextElement());
                if (aLogger.equals(Logger.global) || aLogger.getName() == null || aLogger.getName().length() == 0) {
                    continue;
                }
                if (loggerName == null || aLogger.getName().startsWith(loggerName)) {
                    if (level == null) {
                        logger.info(aLogger.getName() + ": " + aLogger.getLevel());
                    } else {
                        logger.info("set level of logger " + aLogger.getName() + " to " + level);
                        aLogger.setLevel(level);
                    }
                }
            }
        }
View Full Code Here

        Map.Entry p = (Map.Entry) iParams.next();
        String name = (String) p.getKey();
        String value = ((String[]) p.getValue())[0];

        if (name.equals("submit")) continue;
        Logger logger;
        LogManager logManager = LogManager.getLogManager();
        if ("root".equals(name)) {
          logger = logManager.getLogger("");
        } else logger = logManager.getLogger(name);

        if ("unset".equals(value)) {
          if ((logger != null) && (logger.getLevel() != null)) {
            logger.setLevel(null);
            log.info("Unset log level on '" + name + "'.");
          }
        } else {
          Level level = Level.parse(value);
          if (logger == null) logger = Logger.getLogger(name);
          if (logger.getLevel() != level) {
            logger.setLevel(level);
            log.info("Set '" + name + "' to " +
                    level + " level.");
          }
        }
      }
View Full Code Here

    LogManager logManager = LogManager.getLogManager();

    Enumeration<String> loggerNames = logManager.getLoggerNames();
    while (loggerNames.hasMoreElements()) {
      String name = loggerNames.nextElement();
      Logger logger = Logger.getLogger(name);
      LogWrapper wrapper = new LogWrapper(logger);
      roots.remove(wrapper); // Make sure add occurs
      roots.add(wrapper);

      while (true) {
View Full Code Here

        String result = instance.getClient();

        assertEquals("The getClient() method did not return the value set with setClient(): ", expResult, result);

        Logger log = Logger.getLogger("com.sun.grid.Jsv");
        TestHandler handler = new TestHandler();

        log.setLevel(Level.ALL);
        log.addHandler(handler);
        handler.setLevel(Level.ALL);
        instance.setClient(null);
        result = instance.getClient();
       
        assertEquals("The getClient() method did not ignore the null value: ", expResult, result);
View Full Code Here

        String result = instance.getCommandName();

        assertEquals("The getCommandName() method did not return the value set with setCommandName(): ", expResult, result);

        Logger log = Logger.getLogger("com.sun.grid.Jsv");
        TestHandler handler = new TestHandler();

        log.setLevel(Level.ALL);
        log.addHandler(handler);
        handler.setLevel(Level.ALL);
        instance.setCommandName(null);
        result = instance.getCommandName();

        assertEquals("The getCommandName() method did not ignore the null value: ", expResult, result);
View Full Code Here

TOP

Related Classes of java.util.logging.Logger$DefaultHandler

Copyright © 2018 www.massapicom. 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.