132133134135136137138139140141142
* 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();
464748495051525354
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.")); } }
5556575859606162636465
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 }
7374757677787980818283
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);
480481482483484485486487488489490
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); }
161162163164165166167168169170171
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");