Thanks to everyone for your input.

This helps a lot, and I will be sure to read through my copy of the Manual
in this regard.

Thanks!


Mike


-----Original Message-----
From: Ceki G�lc� [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 11:29 AM
To: Log4J Users List
Subject: Re: seeking guidance - wrapping Log4j



Hello Mike,

This question is answered in some detail in "The complete log4j
manual. If my memory serves me right, you have already ordered this
book.

To gist of the answer is that once a logger is created it is bound to
the hierarchy. If a logger of name 'foo' and type X is created, it
cannot be retrieved by the same name *and* a different type. Such
attempts result in ClassCastExceptions.

Wrappers do not suffer from this problem.

If you are sure that the logger hierarchy is totally under your
control, then sub-classing is OK. However, if your code runs in an
application server or a servlet container, then your code might break
in future versions of log4j or the app server or the servlet
container.

HTH,

At 10:50 AM 6/11/2003 -0400, you wrote:



>I receive regular questions from internal customers asking why it is
>recommended to wrap Log4j through aggregation as opposed to inheritance.
>
>I am familiar with the ClassCastException issue found in
>http://jakarta.apache.org/log4j/docs/TROUBLESHOOT.html#cce.
>I have purchased the Log4j Full Manual, and will search for information in
>this regard.  I've noted there is a section in the book covering wrapping
>Log4j.
>
>In addition, would someone please comment on the technical reasons
>aggregation is recommended, as opposed to sub-classing?
>
>Thanks for your time.
>
>Mike

--
Ceki  For log4j documentation consider "The complete log4j manual"
       ISBN: 2970036908  http://www.qos.ch/shop/products/clm_t.jsp 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-------------------------------------------------------------------------------
This message and any included attachments are from Siemens Medical Solutions 
USA, Inc. and are intended only for the addressee(s).  
The information contained herein may include trade secrets or privileged or 
otherwise confidential information.  Unauthorized review, forwarding, printing, 
copying, distributing, or using such information is strictly prohibited and may 
be unlawful.  If you received this message in error, or have reason to believe 
you are not authorized to receive it, please promptly delete this message and 
notify the sender by e-mail with a copy to [EMAIL PROTECTED]  Thank you

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to