logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject RE: Log based on object and not the class
Date Thu, 11 Dec 2003 16:27:21 GMT
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: steve.beech@xks.co.uk [mailto:steve.beech@xks.co.uk]
>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: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message