Package org.apache.log4j

Examples of org.apache.log4j.Category.info()


    root.log(Priority.WARN, MSG); assertEquals(caRoot.counter, 2)
    root.warn(MSG); assertEquals(caRoot.counter, 3)

    BasicConfigurator.disableInfo();
    root.debug(MSG); assertEquals(caRoot.counter, 3)
    root.info(MSG); assertEquals(caRoot.counter, 3)
    root.log(Priority.WARN, MSG); assertEquals(caRoot.counter, 4)
    root.error(MSG); assertEquals(caRoot.counter, 5)
    root.log(Priority.ERROR, MSG); assertEquals(caRoot.counter, 6)

    BasicConfigurator.disableAll();
View Full Code Here


    root.error(MSG); assertEquals(caRoot.counter, 5)
    root.log(Priority.ERROR, MSG); assertEquals(caRoot.counter, 6)

    BasicConfigurator.disableAll();
    root.debug(MSG); assertEquals(caRoot.counter, 6)
    root.info(MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.WARN, MSG); assertEquals(caRoot.counter, 6)
    root.error(MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.FATAL, MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.FATAL, MSG); assertEquals(caRoot.counter, 6)
View Full Code Here

    root.log(Priority.FATAL, MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.FATAL, MSG); assertEquals(caRoot.counter, 6)

    BasicConfigurator.disable(Priority.FATAL);
    root.debug(MSG); assertEquals(caRoot.counter, 6)
    root.info(MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.WARN, MSG); assertEquals(caRoot.counter, 6)
    root.error(MSG); assertEquals(caRoot.counter, 6);
    root.log(Priority.ERROR, MSG); assertEquals(caRoot.counter, 6)
    root.log(Priority.FATAL, MSG); assertEquals(caRoot.counter, 6)
  }
View Full Code Here

   
    cat.debug("Message " + ++i);
    root.debug("Message " + i);       

    cat.info ("Message " + ++i);
    root.info("Message " + i);       

    cat.warn ("Message " + ++i);
    root.warn("Message " + i);       

    cat.error("Message " + ++i);
View Full Code Here

    cat.debug("Message " + ++i);
    root.debug("Message " + i);       

    cat.info ("Message " + ++i);
    root.info("Message " + i);       

    cat.warn ("Message " + ++i);
    root.warn("Message " + i);       

    cat.error("Message " + ++i);
View Full Code Here

    Exception e = new Exception("Just testing");
    cat.debug("Message " + ++i, e);
    root.debug("Message " + i, e);
   
    cat.info("Message " + ++i, e);
    root.info("Message " + i, e);   

    cat.warn("Message " + ++i , e);
    root.warn("Message " + i , e);   

    cat.error("Message " + ++i, e);
View Full Code Here

   
    CAT.debug("Message " + ++i);
    root.debug("Message " + i);       

    CAT.info ("Message " + ++i);
    root.info("Message " + i);       

    CAT.warn ("Message " + ++i);
    root.warn("Message " + i);       

    CAT.error("Message " + ++i);
View Full Code Here

    Exception e = new Exception("Just testing");
    CAT.debug("Message " + ++i, e);
    root.debug("Message " + i, e);
   
    CAT.info("Message " + ++i, e);
    root.info("Message " + i, e);   

    CAT.warn("Message " + ++i , e);
    root.warn("Message " + i , e);   

    CAT.error("Message " + ++i, e);
View Full Code Here

   
    // defaultPriority=DEBUG
    UNDEF.log(Priority.FATAL, "Message " + i); i++;  // 19
    UNDEF.error("Message " + i); i++;        
    UNDEF.warn ("Message " + i); i++;
    UNDEF.info ("Message " + i); i++;
    UNDEF.debug("Message " + i, new Exception("Just testing.")); i++;   

    // -------------------------------------------------
    // The following should not log
    ERR.warn("Message " + i);  i++;
View Full Code Here

        BasicConfigurator.configure();

        Category log = Category.getInstance( CATEGORY_NAME );

        log.info("Hello from Log4jCategoryExample - ready to start velocity");

        /*
         *  now create a new VelocityEngine instance, and
         *  configure it to use the category
         */
 
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.