https://issues.apache.org/bugzilla/show_bug.cgi?id=52676

             Bug #: 52676
           Summary: Location information unavailable when FQCN ends in .
           Product: Log4j
           Version: 1.2
          Platform: Macintosh
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Layout
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


This is arguably a bug in the sample application.

When both extending and wrapping Logger, the sample application suggests that
"It's usually a good idea to add a dot suffix to the fully qualified class
name..."

However, if you do that, the location-related format conversions (%F, %L, etc)
used by org.apache.log4j.PatternLayout do not work correctly. (They print
question marks instead of the actual location info.)

The problem is the following line (org.apache.log4j.spi.LocationInfo, line
143):

    if(fqnOfCallingClass.equals(thisClass)) {
       //...

which checks for an exact match between the FQCN and the class name reported in
the stack trace. The trailing dot prevents the match from succeeding, so the
location information is not fetched. This code should be modified to accept a
trailing dot as a valid match.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to