diff options
Diffstat (limited to 'common/src')
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/logging/Logger.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java index 6999656ab..265ad026d 100644 --- a/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java +++ b/common/src/main/java/at/gv/egovernment/moa/logging/Logger.java @@ -58,7 +58,14 @@ public class Logger { * @return the logger */ private static synchronized org.slf4j.Logger getLogger() { - String className = Thread.currentThread().getStackTrace()[3].getClassName(); + StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace(); + + int i; + for(i = 2; i < stacktrace.length; i++) + if(!stacktrace[i].getClassName().equals(Logger.class.getName())) + break; + + String className = stacktrace[i].getClassName(); org.slf4j.Logger logger = instances.get(className); if (logger != null) { |