From b1f9ac47a3b9674288a21b35133995cae0b4638f Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 28 May 2008 18:33:07 +0000 Subject: [PATCH] If we tell log4j who we are, it will figure out the caller properly. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2316 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/Log4JLogger.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/java/com/samskivert/util/Log4JLogger.java b/src/java/com/samskivert/util/Log4JLogger.java index d3276788..a70d276d 100644 --- a/src/java/com/samskivert/util/Log4JLogger.java +++ b/src/java/com/samskivert/util/Log4JLogger.java @@ -55,7 +55,7 @@ public class Log4JLogger implements Logger.Factory public void debug (Object message, Object... args) { if (_impl.isEnabledFor(Level.DEBUG)) { - _impl.log(Level.DEBUG, format(message, args), getException(message, args)); + _impl.log(_self, Level.DEBUG, format(message, args), getException(message, args)); } } @@ -63,7 +63,7 @@ public class Log4JLogger implements Logger.Factory public void info (Object message, Object... args) { if (_impl.isEnabledFor(Level.INFO)) { - _impl.log(Level.INFO, format(message, args), getException(message, args)); + _impl.log(_self, Level.INFO, format(message, args), getException(message, args)); } } @@ -71,7 +71,7 @@ public class Log4JLogger implements Logger.Factory public void warning (Object message, Object... args) { if (_impl.isEnabledFor(Level.WARN)) { - _impl.log(Level.WARN, format(message, args), getException(message, args)); + _impl.log(_self, Level.WARN, format(message, args), getException(message, args)); } } @@ -79,10 +79,11 @@ public class Log4JLogger implements Logger.Factory public void error (Object message, Object... args) { if (_impl.isEnabledFor(Level.ERROR)) { - _impl.log(Level.ERROR, format(message, args), getException(message, args)); + _impl.log(_self, Level.ERROR, format(message, args), getException(message, args)); } } - protected org.apache.log4j.Logger _impl; + protected final org.apache.log4j.Logger _impl; + protected final String _self = getClass().getName(); } }