1
0

[LOGGING-132] Jdk14Logger now correctly uses the specified logger name.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/logging/trunk@1448063 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart
2013-02-20 10:01:41 +00:00
parent 310645a75a
commit fa3c76104f
3 changed files with 11 additions and 8 deletions

View File

@@ -75,13 +75,13 @@ public class Jdk14Logger implements Log, Serializable {
// Hack (?) to get the stack trace.
Throwable dummyException = new Throwable();
StackTraceElement locations[] = dummyException.getStackTrace();
// Caller will be the third element
String cname = "unknown";
// LOGGING-132: use the provided logger name instead of the class name
String cname = name;
String method = "unknown";
// Caller will be the third element
if( locations != null && locations.length > 2 ) {
StackTraceElement caller=locations[2];
cname=caller.getClassName();
method=caller.getMethodName();
StackTraceElement caller = locations[2];
method = caller.getMethodName();
}
if( ex == null ) {
logger.logp( level, cname, method, msg );