logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: Using PatternLayout and HTMLlayout....
Date Sat, 10 Feb 2007 22:41:23 GMT

On Feb 10, 2007, at 6:35 AM, venkatesh wrote:

> Hi Users,
>   Is it possible to use both layouts (pattern and html) at the same  
> time since i reqd to output the logs to a html file with my  
> customized patterns..
>
> Let me know the way to use like this.
>
> Regards,
> Venkatesh P.
>


general@logging.apache.org is intended for discussions that affect  
all the logging services projects which is generally project  
governance related issues.  The proper mailing list for your question  
is log4j-user@logging.apache.org.

I'll take a stab at your question, but please do not respond on this  
list to say thanks or to continue to ask questions.  If you have more  
questions, please start a new thread on log4j-user.

An FileAppender uses a single Layout to convert a logging event into  
a set of characters.  It does not support multiple layouts and it is  
not obvious how it could in a way that makes general sense.

Likely the best solution to your problem is to define a pattern  
layout with a header that emits the "<html><head>...</ 
head><body>..." , a pattern that produces the HTML for each event  
(likely a <td>) and then a footer like "</table></html>".  If you are  
configuring this using an XML file, remember that you will have to  
represent "<" as "&lt;" and ">" as "&gt;". 

Mime
View raw message