Package org.apache.log4j

Examples of org.apache.log4j.Logger.log()


       * default.
       */
      int level = ((count % 5)+1)*10000;
      String msg = "This is log message number" + String.valueOf(count);

      logger.log(Level.toLevel(level), msg);
      Transaction transaction = ch.getTransaction();
      transaction.begin();
      Event event = ch.take();
      Assert.assertNotNull(event);
      StringBuilder builder = new StringBuilder();
View Full Code Here


    int i  = 0;
    logger.debug( "Message " + i++);
    logger.info( "Message " + i++);
    logger.warn( "Message " + i++);
    logger.error( "Message " + i++);
    logger.log(Level.FATAL, "Message " + i++);
    logger.debug("Message " + i++,  new Exception("Just testing."));
  }
}
View Full Code Here

    long start = System.nanoTime();
    Logger logger = Logger.getLogger(loggerName);
    Level level = Level.toLevel(levelName);
    for(int i=0; i<count; i++)
    {
      logger.log(level, message);
    }
    long end = System.nanoTime();
    return new Double((end - start) / 1000000.0)//in milliseconds
  }
View Full Code Here

    cat.error("Message " + ++i);
    root.error("Message " + i);
   
    cat.log(Level.FATAL, "Message " + ++i);
    root.log(Level.FATAL, "Message " + i);   
   
    Exception e = new Exception("Just testing");
    cat.debug("Message " + ++i, e);
    root.debug("Message " + i, e);
   
View Full Code Here

        if (!log.isEnabledFor(priority)) {
            return;
        }

        log.log(Log4jSink.class.getName(), priority, "" + msg, null);
    }

    public synchronized void log(String s) {
        Logger.getRootLogger().log("jetty.log4jSink", Priority.INFO, s, null);
    }
View Full Code Here

            if (useLog4J) {
                Logger logger = getLogger(module);
                if (SYS_DEBUG != null) {
                    logger.setLevel(Level.DEBUG);
                }
                logger.log(callingClass, levelObjs[level], msg, t);
            } else {
                StringBuffer prefixBuf = new StringBuffer();

                prefixBuf.append(dateFormat.format(new java.util.Date()));
                prefixBuf.append(" [OFBiz");
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.