Package org.apache.log4j

Examples of org.apache.log4j.Priority


        if (ld < 0) ld = lb;
        String class_name = (ld > 0) ? method.substring(0,ld) : method;

        Logger log = Logger.getLogger(class_name);

        Priority priority = Level.INFO;

        if (Log.DEBUG.equals(tag)) {
            priority = Level.DEBUG;
        } else if (Log.WARN.equals(tag) || Log.ASSERT.equals(tag)) {
            priority = Level.ERROR;
View Full Code Here


  /**
   *  Return the current Level of the logger
   */
  public int getCurrentIntLevel() {
    Priority p = category.getPriority();
    return (p==null ? BasicLevel.INHERIT : p.toInt());
  }
View Full Code Here

    Priority p = category.getPriority();
    return (p==null ? BasicLevel.INHERIT : p.toInt());
  }

  public Level getCurrentLevel() {
    Priority p = category.getPriority();
    return (p==null
      ? BasicLevel.LEVEL_INHERIT
      : LevelImpl.getLevel(p.toInt()) );
  }
View Full Code Here

        c.anchor = GridBagConstraints.WEST;

        c.gridy = 0;
        final Priority[] allPriorities = Priority.getAllPossiblePriorities();
        final JComboBox priorities = new JComboBox(allPriorities);
        final Priority lowest = allPriorities[allPriorities.length - 1];
        priorities.setSelectedItem(lowest);
        aModel.setPriorityFilter(lowest);
        gridbag.setConstraints(priorities, c);
        add(priorities);
        priorities.setEditable(false);
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 static class JuliToLog4jHandler extends Handler {

        public void publish(LogRecord record) {
            org.apache.log4j.Logger log4j = getTargetLogger(record.getLoggerName());
            Priority priority = toLog4j(record.getLevel());
            log4j.log(priority, toLog4jMessage(record), record.getThrown());
        }
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

     */
    public static class JuliToLog4jHandler extends Handler {

        public void publish(LogRecord record) {
            org.apache.log4j.Logger log4j = getTargetLogger(record.getLoggerName());
            Priority priority = toLog4j(record.getLevel());
            log4j.log(priority, toLog4jMessage(record), record.getThrown());
        }
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.