Package org.slf4j

Examples of org.slf4j.Logger


  int diff = new Random().nextInt();
 
  public RecursiveAppender() {
    System.out.println("in RecursiveAppender constructor");
    Logger logger = LoggerFactory.getLogger("RecursiveAppender"+diff);
    System.out.println("logger class="+logger.getClass().getName());
    logger.info("Calling a logger in the constructor");
  }
View Full Code Here


    System.clearProperty(CONFIG_FILE_KEY);
    super.tearDown();
  }

  public void testLog4j() {
    Logger logger = LoggerFactory.getLogger("x"+diff);
    System.out.println("logger class="+logger.getClass().getName());
    logger.info("hello");
  }
View Full Code Here

    Log instance = null;
    // protect against concurrent access of loggerMap
    synchronized (loggerMap) {
      instance = (Log) loggerMap.get(name);
      if (instance == null) {
        Logger logger = LoggerFactory.getLogger(name);
        if(logger instanceof LocationAwareLogger) {
          instance = new SLF4JLocationAwareLog((LocationAwareLogger) logger);
        } else {
          instance = new SLF4JLog(logger);
        }
View Full Code Here

   *
   * @return logger with same name as returned by LoggerFactory
   * @throws ObjectStreamException
   */
  protected Object readResolve() throws ObjectStreamException {
    Logger logger = LoggerFactory.getLogger(this.name);
    return new SLF4JLocationAwareLog((LocationAwareLogger) logger);
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.slf4j.ILoggerFactory#getLogger(java.lang.String)
   */
  public Logger getLogger(String name) {
    Logger logger = null;
    // protect against concurrent access of loggerMap
    synchronized (this) {
      logger = (Logger) loggerMap.get(name);
      if (logger == null) {
        org.apache.commons.logging.Log jclLogger = LogFactory.getLog(name);
View Full Code Here

   *
   * @return logger with same name as returned by LoggerFactory
   * @throws ObjectStreamException
   */
  protected Object readResolve() throws ObjectStreamException {
    Logger logger = LoggerFactory.getLogger(this.name);
    return new SLF4JLog(logger);
  }
View Full Code Here

public class Activator implements BundleActivator {

  private BundleContext m_context = null;

  public void start(BundleContext context) {
    Logger logger = LoggerFactory.getLogger(this.getClass());
    logger.info("Activator.start()");
    m_context = context;
  }
View Full Code Here

    m_context = context;
  }

  public void stop(BundleContext context) {
    m_context = null;
    Logger logger = LoggerFactory.getLogger(this.getClass());
    logger.info("Activator.stop");
  }
View Full Code Here

    // when it is not guarded the figure is 90 milliseconds,
    // i.e a ration of 1 to 5000
  }

  double debugLoop(int len) {
    Logger logger = LoggerFactory.getLogger(PerfTest.class);
    long start = System.currentTimeMillis();
    for (int i = 0; i < len; i++) {
      logger.debug("hello");
    }

    long end = System.currentTimeMillis();

    long duration = end - start;
View Full Code Here

@Test
public class PropertyComparatorTest {

  public void testSingleProperty() {
    Logger logger = LoggerFactory.getLogger(PropertyComparatorTest.class);
    logger.info("dd");
  }
View Full Code Here

TOP

Related Classes of org.slf4j.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.