You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2009/04/10 20:54:08 UTC

DO NOT REPLY [Bug 47014] New: Method Name in log (%M) invalid for some callers when using Category.log(...)

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

           Summary: Method Name in log (%M) invalid for some callers when
                    using Category.log(...)
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: larae77@gmail.com


Created an attachment (id=23479)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23479)
Bundled Maven project with unit tests that demonstrat issue in console

Overview: 
The method name returned by %M can be invalid when using the following method:

Category.log(String callerFQCN, Priority level, Object message, Throwable t);

>From a class that has a fully qualified name that is a substring of the
log4j.Logger's category.


Additional Information: 

Attached maven project demonstrates scenario, prints messages to console.

Proposed Fix:
Add "." to end fqnOfCallingClass in LocationInfo before searching stacktrace
for method.

-- 
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 47014] Method Name in log (%M) invalid for some callers when using Category.log(...)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47014





--- Comment #1 from Jacob Kjome <ho...@visi.com>  2009-04-10 20:45:02 PST ---
Adding a period at the end of the FQCN is the recommended way for wrapper
classes to call logger.log(), though I'm not sure read that information (a long
while back).  I'm not sure I see this as a bug in Log4j code, but in
documentation?

-- 
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 47014] Method Name in log (%M) invalid for some callers when using Category.log(...)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47014





--- Comment #2 from Curt Arnold <ca...@apache.org>  2009-05-03 14:28:20 PST ---
Could you check this against the current SVN HEAD?  I believe this has been
fixed, but can't find the bug report at the moment.

-- 
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 47014] Method Name in log (%M) invalid for some callers when using Category.log(...)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47014

Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #3 from Curt Arnold <ca...@apache.org> 2009-10-10 12:41:16 UTC ---
Underlining issue was addressed in bug 44888 committed 2008-05-19.  Other
changes to LocationInfo also address the issue.  It does however break the work
around of appending a trailing "." to the fully qualified file name.

*** This bug has been marked as a duplicate of bug 44888 ***

-- 
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org