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 Amy Cheung <am...@yahoo.com> on 2002/12/17 20:37:29 UTC

design question

I need to subclass log4j to meet the logging standard
defined by our company. The requirements include
specifying a ProductId in every log file. The root
element in the DTD looks like this: 
<!ELEMENT MyLog (ProductId), (Message)*>

New classes I defined include MyLoggerFactory,
MyLogger, and MyLayout etc. To make this ProductId a
configurable parameter in log4j.properties, my first
attempt was to define it in MyLoggerFactory. But soon
I noticed when MyLayout.getHeader() was called,
ProductId in MyLoggerFactory may not have been
initialized, depending on whether DOMConfigurator or
PropertyConfigurator was used. The next straight
forward solution is to define ProductId in MyLayout.
But doing so will cause the user to set the value of
ProductId in every appender where MyLayout is used (in
log4j.properties).  Is there a better solution out
there? thanks,

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>