That is just a way to get printStackTrace to print to a stringwriter...

What if some external library (e.g. the JDK it self) writes to
System.out/System.err ? I cannot
recompile the jdk and replace all system.out/err/printstacktraces with that
source snippet :)

Thanx anyway :)

/max

----- Original Message -----
From: "Jacob Kjome" <[EMAIL PROTECTED]>
To: "Log4J Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 5:16 PM
Subject: Re: The definitive guide for directing System.out/err ?


> Hello Max,
>
> I don't know about a definitive guide, but this is one possible way of
> doing things:
>
> StringWriter sw = new StringWriter();
> ex.printStackTrace(new PrintWriter(sw));
> logger.error("" + sw);
>
>
> Jake
>
> Wednesday, July 24, 2002, 7:30:39 AM, you wrote:
>
> MRA> Hi,
>
> MRA> Looking in the archives i found a handfull of threads discussing the
> MRA> possibility of letting println's (etc.) going to System.out/err being
sent
> MRA> to a log4j catagory instead.
>
> MRA> Anyone that have gathered a complete an definitive guide for how to
do this
> MRA> safely and without running into infinte recursion problems when
something in
> MRA> log4j fails and then tries to write to System.err/out....
>
> MRA> /max
>
>
> MRA> --
> MRA> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> MRA> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>
> --
> Best regards,
>  Jacob                            mailto:[EMAIL PROTECTED]
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to