2013/3/9 Jesse Farinacci <jie...@gmail.com>:
> Greetings,
>
> I am using Java 7, IBM JRE and Apache Tomcat 7.0.37. I am seeing a
> strange difference between java.util.logging.SimpleFormatter vs
> org.apache.juli.OneLineFormatter: namely, for my applications, the
> SimpleFormatter will produce log records with the Class name included
> but OneLineFormatter will not. The exact same application, with only
> changes to the .formatter are enough to show this change.
>
> I think this is a bug; If I use javap on my unpacked class files, I
> see that they do in fact have all the debug details. Why does
> OneLineFormatter show me null.null when SimpleFormatter will show the
> class name? This is very frustrating, and has been going on for quite
> a while..
>

File and method names are provided by JRE. Formatter only uses what is
provided to it.

        // Source
        sb.append(' ');
        sb.append(record.getSourceClassName());
        sb.append('.');
        sb.append(record.getSourceMethodName());

IIRC from reading Oracle JDK 6 sources a while ago, it throws an
exception and takes Nth record from its stacktrace.

It is a costy operation, and if the call depth is wrong (N is wrong)
or if there is no stacktrace (due to optimizations by JIT compiler)
you will not get the names.   IIRC, in some server JVMs if you throw
the same exception X times it no longer prints its stacktrace. Maybe
that is it.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to