Package java.util.logging

Examples of java.util.logging.Logger


        ConsoleHandler ch = new ConsoleHandler();
        ch.setLevel(Level.FINE);
        ch.setFormatter(new LogFormatter());
       
        //Logger http = Logger.getLogger("proxy");
          Logger http = Logger.getLogger("org.xlightweb");
        http.setLevel(Level.FINE);
        http.addHandler(ch);   
       
        Logger http2 = Logger.getLogger("org.xsocket.connection.NonBlockingConnectionPool");
        http2.setLevel(Level.FINE);
        http2.addHandler(ch);
      }
     
     
      if (arg.equalsIgnoreCase("-printMessage")) {
        params.remove(arg);
View Full Code Here


*/
public final class HttpClientRetryTest {

    public static void main(String[] args) throws Exception {
       
        Logger LOG = Logger.getLogger(HttpClientRetryTest.class.getName());
       
        for (int i = 0; i < 10000; i++) {
            LOG.info("loop " + i);
            new HttpClientRetryTest().testSimpleGetRetry();
        }
    }
View Full Code Here

        if (parseOk) {
            if (logOpt.isSet()) {
                Level level = Level.parse(logOpt.getValue());
                Handler h = new StreamHandler(stream, logFormatter);
                h.setLevel(level);
                Logger rootLogger = Logger.getLogger("");
                rootLogger.addHandler(h);
                rootLogger.setLevel(level);
            }
        }
        return parseOk;
    }
View Full Code Here

                        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);
            } 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
View Full Code Here

   * @param sComponent component to get the level for
   * @return the logging level
   */
  public static Integer getLevel(final String sComponent){
    if (useJavaLogger){
      final Logger logger = Logger.getLogger(sComponent);
     
      final Level level = logger.getLevel();
     
      final int l = level.intValue();
     
      if (l<=Level.FINEST.intValue())
        return Integer.valueOf(FINEST);
View Full Code Here

   * @param sComponent component
   * @return true if the message will be logged, false otherwise
   */
  public static boolean isLoggable(final int level, final String sComponent) {
    if (useJavaLogger){
      final Logger logger = Logger.getLogger(sComponent);
      return logger.isLoggable(getJavaLoggerLevel(level));
    }
   
    return level <= getLevel(sComponent).intValue();
  }
View Full Code Here

    if (level < 0 || level > FINEST) {
      throw new IllegalArgumentException("level must be between 0 (FATAL) and 6 (FINEST)"); //$NON-NLS-1$
    }
   
    if (useJavaLogger){
      final Logger logger = Logger.getLogger(sComponent);
     
      logger.log(getJavaLoggerLevel(level), sMessage);
     
      return;
    }

    if (!isLoggable(level, sComponent))
View Full Code Here

      Thread.yield();
      result = wm;
      String preScript = System.getProperty("wrapper.app.pre_main.script");
      if (preScript != null & !"".equals(preScript))
      {
        Logger logger = new MyLogger();
        logger.addHandler(new ConsoleHandler());
        wm.executeScript(preScript, wrapperClassLoader);
      }

    }
    catch (Exception e1)
View Full Code Here

       record.getSourceClassName() + "] " +
       record.getMessage() + "\n";
  }
 
  public static void intialize() {
    Logger root = Logger.getLogger("");
    Handler[] handlers = root.getHandlers()// returns 1

    for (int i = 0; i < handlers.length; i++) {
      if (handlers[i] instanceof ConsoleHandler) {
        ((ConsoleHandler) handlers[i]).setFormatter(new LoggerShortFormat());
        ((ConsoleHandler) handlers[i]).setLevel(Level.OFF);
View Full Code Here

    String preScript = System.getProperty("wrapper.app.pre.script");
    if (preScript != null & !"".equals(preScript))
      try
      {
        Logger logger = new MyLogger();
        logger.addHandler(new ConsoleHandler());
        System.out.println("wrapped process: executing pre script " + preScript);
        Script script = ScriptFactory.createScript(preScript, "", null, new String[0], null, 0);
        if (script != null)
          script.execute();
        else
View Full Code Here

TOP

Related Classes of java.util.logging.Logger

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.