Adapt after Argeo Suite refactoring.
[lgpl/argeo-commons.git] / org.argeo.init / src / org / argeo / init / logging / ThinLogging.java
index 9866a1f232e2a218d9c98d8699b089f619ca7d01..cdcabcb03060902a54a7698d08cc3ec49d51596a 100644 (file)
@@ -216,7 +216,7 @@ class ThinLogging implements Consumer<Map<String, Object>> {
        /*
         * INTERNAL CLASSES
         */
-       
+
        private class ThinLogger implements System.Logger {
                private final String name;
 
@@ -285,6 +285,7 @@ class ThinLogging implements Consumer<Map<String, Object>> {
                private StackTraceElement findCallLocation(Level level, Thread thread) {
                        assert level != null;
                        assert thread != null;
+                       // TODO rather use a StackWalker and make it smarter
                        StackTraceElement callLocation = null;
                        if (level.getSeverity() >= callLocationLevel.getSeverity()) {
                                StackTraceElement[] stack = thread.getStackTrace();
@@ -293,13 +294,17 @@ class ThinLogging implements Consumer<Map<String, Object>> {
                                        String className = stack[i].getClassName();
                                        switch (className) {
                                        // TODO make it more configurable
+                                       // FIXME deal with privileges stacks (in Equinox)
                                        case "java.lang.System$Logger":
                                        case "java.util.logging.Logger":
                                        case "org.apache.commons.logging.Log":
                                        case "org.osgi.service.log.Logger":
-                                       case "org.argeo.cms.Log":
+                                       case "org.eclipse.osgi.internal.log.LoggerImpl":
+                                       case "org.argeo.api.cms.CmsLog":
                                        case "org.slf4j.impl.ArgeoLogger":
+                                       case "org.argeo.cms.internal.osgi.CmsOsgiLogger":
                                        case "org.eclipse.jetty.util.log.Slf4jLog":
+                                       case "sun.util.logging.internal.LoggingProviderImpl$JULWrapper":
                                                lowestLoggerInterface = i;
                                                continue stack;
                                        default:
@@ -519,12 +524,13 @@ class ThinLogging implements Consumer<Map<String, Object>> {
                        sb.append('\n');
                        for (StackTraceElement ste : throwable.getStackTrace()) {
                                sb.append(prefix);
+                               sb.append('\t');
                                sb.append(ste.toString());
                                sb.append('\n');
                        }
                        if (throwable.getCause() != null) {
                                sb.append(prefix);
-                               sb.append("caused by ");
+                               sb.append("Caused by: ");
                                addThrowable(sb, prefix, throwable.getCause());
                        }
                }