You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Steve Pruitt <SP...@exstream.com> on 2005/11/18 00:23:34 UTC

Custom html layout

It seems I can solve my custom pattern + html layout dilemma with a
custom layout.  I extended the log4j HTMLLayout class and overrode the
format and getHeader methods.  In the getHeader method,  I return
everything as in the log4j HTMLLayout class header, except I return the
different column headings I need.  In the format method, I return the
custom row to match the columns.

There are two thing I haven't done yet.
1) Override the Log session start time timestamp.  Its in header, so I
probably generate it each time I answer getHeader() invokes.

2) The column widths act a little screwy.  They stay fixed with the
log4j HTMLLayout, but in my custom class they resize according to how
the format written out.  I need to research HTML tables a little.

Can anyone think of something that might bite me using this custom
layout class?


-S

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