Package ch.qos.logback.classic

Examples of ch.qos.logback.classic.Logger.info()


  @Override
  public void runThroughputTest(int lines, Histogram histogram) {
    long s1 = System.nanoTime();
    Logger logger = (Logger) LoggerFactory.getLogger(getClass());
    for (int j = 0; j < lines; j++) {
      logger.info(THROUGHPUT_MSG);
    }
    long s2 = System.nanoTime();
    long opsPerSec = (1000L * 1000L * 1000L * lines) / (s2 - s1);
    histogram.addObservation(opsPerSec);
  }
View Full Code Here


  public void runLatencyTest(int samples, Histogram histogram,
      long nanoTimeCost, int threadCount) {
    Logger logger = (Logger) LoggerFactory.getLogger(getClass());
    for (int i = 0; i < samples; i++) {
      long s1 = System.nanoTime();
      logger.info(LATENCY_MSG);
      long s2 = System.nanoTime();
      long value = s2 - s1 - nanoTimeCost;
      if (value > 0) {
        histogram.addObservation(value);
      }
View Full Code Here

  }

  @Override
  public void log(String msg) {
    Logger logger = (Logger) LoggerFactory.getLogger(getClass());
    logger.info(msg);
  }
}
View Full Code Here

    @Override
    public void runThroughputTest(final int lines, final Histogram histogram) {
        final long s1 = System.nanoTime();
        final Logger logger = (Logger) LoggerFactory.getLogger(getClass());
        for (int j = 0; j < lines; j++) {
            logger.info(THROUGHPUT_MSG);
        }
        final long s2 = System.nanoTime();
        final long opsPerSec = (1000L * 1000L * 1000L * lines) / (s2 - s1);
        histogram.addObservation(opsPerSec);
    }
View Full Code Here

    public void runLatencyTest(final int samples, final Histogram histogram,
            final long nanoTimeCost, final int threadCount) {
        final Logger logger = (Logger) LoggerFactory.getLogger(getClass());
        for (int i = 0; i < samples; i++) {
            final long s1 = System.nanoTime();
            logger.info(LATENCY_MSG);
            final long s2 = System.nanoTime();
            final long value = s2 - s1 - nanoTimeCost;
            if (value > 0) {
                histogram.addObservation(value);
            }
View Full Code Here

    }

    @Override
    public void log(final String msg) {
        final Logger logger = (Logger) LoggerFactory.getLogger(getClass());
        logger.info(msg);
    }
}
View Full Code Here

        appender.start();

        for (int i = 0; i < 1000; i++) {
            StopWatch stopWatch = new StopWatch("testOverflow");
            Math.random(); //this should happen super fast, faster than the appender's Dispatcher thread can drain
            logger.info(stopWatch.stop());
        }

        //again close the appender
        appender.stop();
        assertTrue("Expected some stop watch messages to get discarded", appender.getNumDiscardedMessages() > 0);
View Full Code Here

    configurator.doConfigure("/home/ceki/lbcore211.xml");

    Logger l = lc.getLogger("file.logger");
    StatusPrinter.print(lc);
    for (int i = 0; i < 10; i++) {
      l.info("hello " + i);
    }

    lc.stop();
  }
}
View Full Code Here

    logger.setAdditive(false);
    logger.addAppender(socketAppender);


    for (int i = 0; i < runLen; ++i) {
      logger.info("hello");
    }

    allMessagesReceivedLatch.await();

    assertEquals(runLen, listAppender.list.size());
View Full Code Here

    Logger logger = (Logger) LoggerFactory.getLogger(Main.class);
    StatusPrinter.print((LoggerContext) LoggerFactory.getILoggerFactory());
    OThread ot = new OThread();
    ot.start();
    Thread.sleep(OThread.WAIT_MILLIS-500);
    logger.info("About to interrupt");
    ot.interrupt();
    logger.info("After interrupt");
    logger.info("Leaving main");

  }
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.