Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-601

Log.log and isEnabled react differently for marker filters

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Do
    • Affects Version/s: 2.0-rc1
    • Fix Version/s: None
    • Component/s: Filters
    • Labels:
      None
    • Environment:

      OSX 10.8/10.9, Eclipse, Java 1.6/1.7

      Description

      I am trying to determine if a logger exists for a Marker in Log4j 2. The filter works when actually logging. The problem is when checking isEnabled(level, marker). If the MarkerFilters are at the Configuration level, then it works as expected. If at the logger or appender level, then it bypasses the marker and considers only the threshold level.

      Looking at the documentation, it looks like if accepted/denied is at the configuration level, then it will not check any other filters and that status will be honored, so that makes sense that it works here.

      Is this the expected behavior that the isEnabled works only at the configuration level and is not expected to represent whether or not a message will be logged? Or is it that if isEnabled returns true, then the message should be logged?

        Attachments

        1. console_atConfigLevel.txt
          0.4 kB
          Dan Hagberg
        2. console_atLoggerLevel.txt
          0.4 kB
          Dan Hagberg
        3. console_noFilter.txt
          0.4 kB
          Dan Hagberg
        4. DbMarkers.java
          0.5 kB
          Dan Hagberg
        5. log4j2_atConfigLevel.xml
          1 kB
          Dan Hagberg
        6. log4j2_atLoggerLevel.xml
          1 kB
          Dan Hagberg
        7. log4j2_nofilter.xml
          0.9 kB
          Dan Hagberg
        8. TestLog2.java
          1 kB
          Dan Hagberg

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dhagberg Dan Hagberg
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: