logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Mactaggart" <st...@golftime.com.au>
Subject RE: Proposed Enhancments to HTMLLayout
Date Wed, 12 May 2004 03:28:16 GMT
> > 1st cut, I'd like to implement the layout management in the 
> > same way as the
> > pattern layout, using %? Values for each type and some sort 
> > of delimiter to
> > break up columns.
> 
> One way to accomplish this is to 'wrap' a pattern layout 
> inside the new
> HTMLLayout, and use it for line/row rendering.  Then it's 
> just a matter of
> outputting a header, iterating through each event in the buffer and
> formatting with PatternLayout, and then outputting the footer.

I think wrap is a bit strong, as we will require each field individually to
add in the html required to do table cells and such.  But I get what you are
talking about.

On further looking, most of the code that does the formatting for the
PatternLayout is not in the layout itself but in 2 helpers, PatternConverter
and PatternParser.

I have done an initial version of my new HTMLLayout, by taking the code of
the PatternLayout and merging in the way the existing HTMLLayout code works.
This solution seems to be very simple at the moment, and does 80% of what
I'm looking for.

The biggest issue I have is with the PatternParsers themselves, what would
be good would be to be able to get a textual title name from the
PatternParser to say what data it's parsing (ie. Date, Thread, Message,
etc...)  then this could be used to format the title row, and allow dynamic
coloring of each cell.

The PatternParser would need a new method like getFormattingItem() or
something like that, and then when each instance of the PatternParser (or
sub-class) is initiated it determines what data it's formatiing and allows
access to that name..

What's the chance of getting this addition to the PatternParser's?

> 
> It'd be nice to able to specify via a configurable property 
> where to get a
> different Header/footer string (say via a resource path), or 
> provide it via
> a simple string property.  e.g...
> 
> public void setHeader(String)
> public void setHeaderResource(String)
> 
> The activateOptions method could then decide to use one over 
> the other as
> priority, but initialise itself accordingly by either taking 
> the simple
> string, or loading the resource as a string.  If this 
> approach is taken, it
> would be great to support l8n character sets somehow too.
>  

This already exists in the form of Title, but the resource option doesn't,
so good point.


> > After that more customisations (if needed) like colours or 
> > word highlighting
> > or row colouring.
> > I don't see these to be a core component of logging, so will 
> > not look at
> > them until the first set are done, but some people may find 
> > it useful to
> > configure these features too.
> 
> It's pretty to have, but not essential, although I think a 
> table is much
> more readable with row-striping, so maybe have a default 
> row-stripe colour,
> and that could be set via configuration 
> (setOddRowColour("#FFFFFF") etc ..).
> 

I liked this one and so mine supports it already, it  does make reading the
rows much easier.

> Anyway, this is just stuff that is coming out of my head.
> 
> cheers,
> 
> Paul Smith
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org


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


Mime
View raw message