Return-Path: Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: (qmail 26747 invoked from network); 16 May 2008 07:50:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 May 2008 07:50:11 -0000 Received: (qmail 44034 invoked by uid 500); 16 May 2008 07:50:13 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 44001 invoked by uid 500); 16 May 2008 07:50:13 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 43985 invoked by uid 99); 16 May 2008 07:50:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2008 00:50:13 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2008 07:49:27 +0000 Received: by brutus.apache.org (Postfix, from userid 33) id E3731234C114; Fri, 16 May 2008 00:49:47 -0700 (PDT) From: bugzilla@apache.org To: log4j-dev@logging.apache.org Subject: DO NOT REPLY [Bug 44888] problem in showing Filename and Line number in log file X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Log4j X-Bugzilla-Component: Appender X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rgoers@apache.org X-Bugzilla-Status: NEEDINFO X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: log4j-dev@logging.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Message-Id: <20080516074947.E3731234C114@brutus.apache.org> Date: Fri, 16 May 2008 00:49:47 -0700 (PDT) X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=44888 --- Comment #6 from Ralph Goers 2008-05-16 00:49:47 PST --- I ran the build and it was successful. I modified the Appender code I showed below to print the stacktrace and the info in LocationInfo before it was corrected. From that I was able to determine what the problem is. The code is only matching up to a class name the length of the FQCN. In the case below that means it matches LoggerUtilTest when it shouldn't have. I modified LocationInfoTest with a new test case and created a new class to simulate the behvior and it failed. If included both after the stack trace. I'll still look into creating a Java 5 version of this. However you fix this for 1.3 is just going to make it even slower. className: sun.reflect.NativeMethodAccessorImpl filename: ? lineNumber: ? methodName: invoke0 FQCN: com.diginsite.services.logging.LoggerUtil java.lang.Throwable at org.apache.log4j.spi.LocationAppender.append(LocationAppender.java:20) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66) at org.apache.log4j.Category.callAppenders(Category.java:206) at org.apache.log4j.Category.forcedLog(Category.java:391) at org.apache.log4j.Category.log(Category.java:856) at org.slf4j.impl.Log4jLoggerAdapter.log(Log4jLoggerAdapter.java:509) at com.diginsite.services.logging.LoggerUtil.entering(LoggerUtil.java:121) at com.diginsite.services.logging.LoggerUtilTest.testDefaultEntering(LoggerUtilTest.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) new test case for LocationInfoTest.java /** * Tests creation of location info from a throwable and where the * FQCN is part of the caller's name. */ public void testLocationInfo() { LocationInfo li = new LocationIn().getLocationInfo(); final String className = LocationInfoTest.class.getName(); final String methodName = "testLocationInfo"; final String fileName = "LocationInfoTest.java"; final String lineNumber = "49"; assertEquals(className, li.getClassName()); assertEquals(methodName, li.getMethodName()); assertEquals(fileName, li.getFileName()); assertEquals(lineNumber, li.getLineNumber()); assertEquals(className + "." + methodName + "(" + fileName + ":" + lineNumber + ")", li.fullInfo); } LocationIn.java package org.apache.log4j.spi; /** * */ public class LocationIn { public LocationInfo getLocationInfo() { Throwable t = new Throwable(); String fqcn = LocationIn.class.getName(); return new LocationInfo(t, fqcn); } } -- 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