You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Allan Crooks <am...@dcs.qmw.ac.uk> on 2001/03/08 17:46:14 UTC

HTMLPrintWriter

Hi,

In reference to the bug I submitted that throwable information isn't
printed in HTMLLayout after the LoggingEvent is serialized.

Well, I did mail my (somewhat inefficient) hack, where the
throwableInformation is read back in with a StringReader, and a
BufferedReader is wrapped round it, and then each line is read from the
reader and then written to HTMLPrintWriter.

Well, I've quickly written a couple of writer classes similar to
StringWriter, except that it returns an array of strings instead of just
one string. Every invocation of println indicates to the internal writer object that a line
has been terminated, and it then starts a new one.

I've tested it to retrieve information about a stack trace, and it seems
to work quite well, so if anyone's interested, could you let me know? I'm
not on the mailing list, so could any reply be cc:'d to me as well,
thanks.

I think the LoggingEvent class could be changed so that the
throwableInformation is actually an array of strings rather than a string,
therefore, a layout can then concatenate the strings with /n, /r, <br>
or whatever it wishes to put returns...

Anyway, let me know what you think,
Allan.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org