Ceki, Thats an excellent solution. It's not very intrusive to the application. I pay the expense of an extra method call but the benefits probably outweigh the cost.
Thank you very much. -----Original Message----- From: Ceki Gülcü [mailto:[EMAIL PROTECTED] Sent: Thursday, December 11, 2003 9:27 AM To: Log4J Users List Subject: RE: Log based on object and not the class Scott, I just committed a possible solution to the problem you raised. You can look at it here: http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/examples/objectBased/ Does it solve the problem? At 08:56 AM 12/11/2003 -0700, you wrote: >I considered doing something like you suggested but I just hate to add code >in order to handle logging. Our application is very large and I would have >to add some object layers in order to get it to work. It seems like >overkill. For now I may just put external filters on my application that >simply display the messages I am interested in. > >Thanks for the response. > >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Sent: Thursday, December 11, 2003 8:47 AM >To: Log4J Users List >Subject: Re: Log based on object and not the class > > >Scott, > >Why not add a switch parameter to the parent method? > >i.e > >Class Parent { > ... > Public void myMethod(boolean b) { > if (b==true) { > Logger.debug("logging message"); > } > } >} > >Class Child1 extends Parent { > ... > Public void execute1() { > this.myMethod(true); > } >} > >Class Child2 extends Parent { > ... > Public void execute2() { > this.myMethod(false); > } >} > >Steve -- Ceki Gülcü 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]