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 Ana-Maria Oleski <an...@x-mail.net> on 2003/10/29 10:57:24 UTC

how to set header?

Hi,

I've noticed there is an abstract getHeader() method in the Layout class, which is used
for example in HTMLLayout to set the html header.

What I would need is to set the header for a logfile in the log4j configuration file.
I'm writing performance data in a CSV format and I'd like to write the column names at
the beginning of the file.
 
I had originally hoped that I can set a "header" property for the ConversionPattern
layout, something like 

log4j.appender.statistics.layout.ConversionPattern= %d{yyyy-MM-dd};%d{HH:mm:ss}; %m%n
log4j.appender.statistics.layout.header=Day;Hour;Action;Millis

but that doesn't work. 

Should I write an own layout class (and if yes how do I get the value of the header
property from the configuration file into my HeaderLayout instance?). Or is there an
easier way?

Thanx,
Ana 

-------------------------------------------------------------------------------------------
***Protect your PC from local E-Mail Application security holes***
***Maintain your Privacy - MS Passport Free***
***Anti SPAM "Whitelist" feature***

http://www.x-mail.net Web Based E-Mail, accessible anywhere

Voice Messages, Voice Calls (VoIP), Video Conferencing, Live Chat, 
X-Mail Messenger, Personal Web Hosting, 128 bit SSL Secure, 
Calendar, Bookmarks, Forwarding, Virtual Mail Map Aliasing

X-Mail Premium: 20MB Messages, 100MB Storage, SMTP, POP3, Ad Free
-------------------------------------------------------------------------------------------
Anonymous Web Surfing http://www.snoopblocker.com
Search http://www.teradex.com
  




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