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.



[email protected] 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 [EMAIL PROTECTED]

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;".

Reply via email to