Package org.apache.log4j

Examples of org.apache.log4j.Priority


  public void Create()
  {
    AdtMessage adtmsg;
    TLogQueue datalog;
   
      Priority priority = null;
      LoggingEvent  event;
      String        fqnOfCategoryClass = "fqnOfCategoryClass";
      Throwable     myThrowable = null;
   
    try{
View Full Code Here


    /**
     * Tests LoggingEvent.fqnOfCategoryClass.
     */
  public void testFQNOfCategoryClass() {
      Category root = Logger.getRootLogger();
      Priority info = Level.INFO;
      String catName = Logger.class.toString();
      LoggingEvent event =
        new LoggingEvent(
          catName, root, info, "Hello, world.", null);
      assertEquals(catName, event.fqnOfCategoryClass);
View Full Code Here

     * Tests LoggingEvent.level.
     * @deprecated
     */
  public void testLevel() {
      Category root = Logger.getRootLogger();
      Priority info = Level.INFO;
      String catName = Logger.class.toString();
      LoggingEvent event =
        new LoggingEvent(
          catName, root, 0L,  info, "Hello, world.", null);
      Priority error = Level.ERROR;
      event.level = error;
      assertEquals(Level.ERROR, event.level);
  }
View Full Code Here

     * Tests LoggingEvent.getLocationInfo() when no FQCN is specified.
     * See bug 41186.
     */
  public void testLocationInfoNoFQCN() {
      Category root = Logger.getRootLogger();
    Priority level = Level.INFO;
      LoggingEvent event =
        new LoggingEvent(
          null, root, 0L,  level, "Hello, world.", null);
      LocationInfo info = event.getLocationInformation();
    //
View Full Code Here

     * on the message parameter does not propagate to caller.
     * See bug 37182.
     */
    public void testBadMessage() {
        Category root = Logger.getRootLogger();
        Priority info = Level.INFO;
        String catName = Logger.class.toString();
        BadMessage msg = new BadMessage();
        LoggingEvent event =
          new LoggingEvent(
            catName, root, 0L,  info, msg, null);
View Full Code Here

        return true;
    }

    public void publish(final LogRecord record) {
        Logger targetLogger = Logger.getLogger(record.getLoggerName());
        final Priority targetLevel = levelMapper.getTargetLevelForSourceLevel(record.getLevel());
        final String text = formatRecord(record);
        targetLogger.log(LOGGER_CLASS_NAME, targetLevel, text, record.getThrown());
    }
View Full Code Here

                pw.print(callFrame);
            }
            pw.close();
            String stackTrace = sw.getBuffer().toString();
            Level level = this.getLevel(traceLevel);
            Priority priority = this.getLogPriority();
            if ( level.isGreaterOrEqual(priority)) {
                logger.log(level,stackTrace);
            }

        }
View Full Code Here

        public Priority getThreshold() {
            return TO_LOG4J.get(handler.getLevel());
        }
        @Override
        public boolean isAsSevereAsThreshold(Priority priority) {
            Priority p = getThreshold();
            return (p == null) || priority.isGreaterOrEqual(p);
        }       
View Full Code Here

        // Increase log4j verbosity based on number of "-d" options specified.
        int debug = isFlagSet('d');
        if (debug>0) {
            Priority[] allPriorities = Priority.getAllPossiblePriorities();
            Priority currentPriority = Category.getRoot().getPriority();
            for (int i=0; i<allPriorities.length; i++) {
                if (currentPriority == allPriorities[i]) {
                    i += debug;
                    if (i>=allPriorities.length) i=allPriorities.length-1;
                    Category.getRoot().setPriority(allPriorities[i]);
View Full Code Here

        public Priority getThreshold() {
            return TO_LOG4J.get(handler.getLevel());
        }
        @Override
        public boolean isAsSevereAsThreshold(Priority priority) {
            Priority p = getThreshold();
            return (p == null) || priority.isGreaterOrEqual(p);
        }       
View Full Code Here

TOP

Related Classes of org.apache.log4j.Priority

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.