You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Pierre De Rop <pi...@gmail.com> on 2010/01/15 22:36:26 UTC

Stacktraces are not displayed by the "log" Felix shell command

Hello everyone,

I'm using the felix log service, and I noticed that exceptions stracktraces
are not dumped, when invoking the felix "log" shell command.
Indeed, in the shell, the LogCommandImpl.display method is currently doing
this:

        if (entry.getException() != null)
        {

buffer.append(entry.getException().getClass().getName()).append(":
").append(
                entry.getException().getMessage());
        }

And, currently, it's impossible to inspect stacktraces, using the "log"
command.
So, would you be ok for the following fix ->

        if (entry.getException() != null)
        {
            StringWriter writer = new StringWriter();
            PrintWriter  pw = new PrintWriter(writer);
            entry.getException().printStackTrace(pw);
            buffer.append(writer.toString());
        }

thanks;
/pierre

Re: Stacktraces are not displayed by the "log" Felix shell command

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Seems ok to me. Open a JIRA issue.

-> richard

On 1/15/10 16:36, Pierre De Rop wrote:
> Hello everyone,
>
> I'm using the felix log service, and I noticed that exceptions stracktraces
> are not dumped, when invoking the felix "log" shell command.
> Indeed, in the shell, the LogCommandImpl.display method is currently doing
> this:
>
>          if (entry.getException() != null)
>          {
>
> buffer.append(entry.getException().getClass().getName()).append(":
> ").append(
>                  entry.getException().getMessage());
>          }
>
> And, currently, it's impossible to inspect stacktraces, using the "log"
> command.
> So, would you be ok for the following fix ->
>
>          if (entry.getException() != null)
>          {
>              StringWriter writer = new StringWriter();
>              PrintWriter  pw = new PrintWriter(writer);
>              entry.getException().printStackTrace(pw);
>              buffer.append(writer.toString());
>          }
>
> thanks;
> /pierre
>
>