logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: Where is it documented that you can supply a Throwable in a varargs log message?
Date Fri, 29 Jan 2016 22:22:12 GMT
That only works when you call an API that is typed with Throwable.

G
On Jan 29, 2016 2:11 PM, "Matt Sicker" <boards@gmail.com> wrote:

> Why can't it log the stack trace as well? Can't you specify
> %throwable{full} in the pattern?
>
> On 29 January 2016 at 16:00, Gary Gregory <garydgregory@gmail.com> wrote:
>
> > What is misleading IMO is that the var arg API will NOT log the stack
> > trace.
> >
> > There is no way to log with a message template, args, and also an
> > exception.
> >
> > This bites me from time to time.
> >
> > What I need is an API that looks like this:
> >
> > Logger.debug(ex, "blah {} {}", arg1, arg2):
> >
> > Gary
> > On Jan 29, 2016 1:28 PM, "Matt Sicker" <boards@gmail.com> wrote:
> >
> > > Like when you do logger.debug("{}", foo, ex). I know it's supported,
> but
> > I
> > > can't find anywhere that this is mentioned.
> > >
> > > --
> > > Matt Sicker <boards@gmail.com>
> > >
> >
>
>
>
> --
> Matt Sicker <boards@gmail.com>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message