i am using org.eclipse.equinox.log_1.0.100.v20070226 (Eclipse 3.3)
as osgi logging implementation for a small server application build
on equinox. I also implemented my own LogListener so i get informed
about new log events.
Everything is working just fine, but i am not able to get the stacktrace
of a LogEntry. I understand that the original exceptions are converted
to implementation specific exceptions like
"org.eclipse.equinox.log.LoggedException", but gets the stacktrace lost?
public void logged(LogEntry arg0) {
if (arg0.getException() != null) {
// this command show about 21 lines of the stacktrace on the console
arg0.getException().printStackTrace();
// The length of the stacktrace is zero (no stacktrace)
arg0.getException().getStackTrace().length
}
}
Is there a way to get the whole stacktrace of a logged exception?
Does anyone have any idea or workaround?
(maybe i have an understanding problem?)
You should log an enhancement request in bugzilla.
getStackTrace was added in Java 1.4 however the OSGi services are written to
work with earlier and mobile VMs.
Perhaps support could be added.
The only workaround I can think of is to write the stacktrace to your own
buffer and then recreate it.
HTH
-Simon
"Dieter" <dieter.schulten@d-velop.de> wrote in message
news:fj8oni$he4$1@build.eclipse.org...
> Hello *,
>
> i am using org.eclipse.equinox.log_1.0.100.v20070226 (Eclipse 3.3)
> as osgi logging implementation for a small server application build
> on equinox. I also implemented my own LogListener so i get informed
> about new log events.
>
> Everything is working just fine, but i am not able to get the stacktrace
> of a LogEntry. I understand that the original exceptions are converted
> to implementation specific exceptions like
> "org.eclipse.equinox.log.LoggedException", but gets the stacktrace lost?
>
>
> public void logged(LogEntry arg0) {
> if (arg0.getException() != null) {
>
> // this command show about 21 lines of the stacktrace on the console
> arg0.getException().printStackTrace();
>
> // The length of the stacktrace is zero (no stacktrace)
> arg0.getException().getStackTrace().length
>
> }
> }
>
> Is there a way to get the whole stacktrace of a logged exception?
>
> Does anyone have any idea or workaround?
> (maybe i have an understanding problem?)
>
> best regards
> dieter