Created attachment 23479 [details] 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.
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?
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.
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 ***