Scott, I guess my ultimate feeling on this is that we shouldn't try to second guess ourselves on performance issues until it is a problem. The value of tracing is too great to not put it in your code... possibly everywhere. If it helps you debug problems quickly, then it'll save you more time on more important issues like how to scale your system correctly. Offloading work to other servers will give you better performance than worrying about wasting CPU on simple boolean resolutions. Everything we do in our field is a game of tradeoffs and again my belief is that we need to focus on robust code first and performance later because you may not be able to anticipate where all the performance hits are until the whole system is built. If these boolean calls are an issue, there are other tricks like calling static final boolean constants so that you can compile out the trace calls from your code. -Benson
Scott Coleman wrote: > Benson, > > OK, I agree with you that it would be nice to add logging, but I also think > that it should not be done across all methods. Only methods that are subject > to be called externally (i.e. the log4j API). > > Regards > Scott > > > -----Original Message----- > From: Benson Chen [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 18, 2001 4:18 PM > To: Log4J Developers List > Subject: Re: automatic trace insertion > > Scott, > > My reasoning for doing so is that I'd rather take the small performance hit > of > adding trace code in order to quickly diagnose problems that happen during a > system integration test or even in production than spend days or even weeks > trying to figure out what caused my code to blow up. This may not be an > issue > with small localized code but when you're talking about gluing together code > from different developers from different organizations, you'll need to be > able > to trace exactly where the error occurred and what steps lead up to that > failure. > Plus you would need to make sure you can enable or disable the trace calls > by > simply calling... > if(trace.isDebugEnabled()){ > trace.debug(...blah...); > } > This way you can disable it in production and a quick "if" statement is a > small > performance overhead considering the benefits of tracing. Now, I have not > looked into the assert feature in jdk1.4 but I do love log4j. I guess it is > ultimately your style and preference but that's my 2 pennies. But I'm glad > you > brought up performance as a possible issue because that's a sign of a good > developer. :-) -Benson > > Scott Coleman wrote: > > > Hi, > > > > I have not read the whole article yet, but I think you will get a heavy > > performance penalty if you use JPDA. > > Can someone please explain to me why you would want to log both entry and > > exit calls, for such a thin layer in the code. I thought that it was meant > > to be very fast. So why would you want to add the performance overhead of > > logging entry and exit information. If you were to go down this path would > > it not be better to use jdk 1.4's new assert feature ? > > > > Regards > > Scott > > > > -----Original Message----- > > From: Cakalic, James [mailto:[EMAIL PROTECTED]] > > Sent: Monday, December 17, 2001 11:37 PM > > To: 'Log4J Developers List' > > Subject: RE: automatic trace insertion > > > > This article about Jylog -- a JPDA based logging generator -- just > appeared > > on JavaWorld. Perhaps it relevant? > > http://www.javaworld.com/javaworld/jw-12-2001/jw-1214-jylog.html > > > > Jim > > > > > -----Original Message----- > > > From: Paul Glezen [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, December 17, 2001 4:25 PM > > > To: Log4J Developers List > > > Subject: Re: automatic trace insertion > > > > > > > > > Hi Benson, > > > > > > It's not as easy as it looks to do "intelligently". While it is often > > > taught that methods should have a single entry point and exit > > > point, not > > > many programmers adhear to this. It is not at all uncommon > > > to find return > > > statements in if-blocks and try-catch blocks. Sometimes the > > > exit logic can > > > get very convoluted. > > > > > > I've always been partial to single exit logic. I didn't > > > become a fan until > > > trying to insert trace statements, just as you describe, in > > > other people's > > > code. It can be a nightmare. > > > > > > - Paul > > > > > > Paul Glezen > > > Consulting IT Specialist > > > IBM Software Services for WebSphere > > > 818 539 3321 > > > > > > > > > Benson Chen <[EMAIL PROTECTED]>@porivo.com on 12/17/2001 01:57:15 PM > > > > > > Please respond to "Log4J Developers List" > > > <[EMAIL PROTECTED]> > > > > > > Sent by: [EMAIL PROTECTED] > > > > > > > > > To: [EMAIL PROTECTED] > > > cc: > > > Subject: automatic trace insertion > > > > > > > > > > > > Hi all, > > > > > > I'm interested in automatically inserting log4j trace > > > statements at the > > > beginning of all methods and right before the end of a method (return > > > statement or thrown exception). I'm presuming most people have worked > > > on projects with extensive class libraries and it would be great if > > > there was a class parser that could intelligently insert log4j > > > statements automatically. If there isn't anything out there > > > like that, > > > does anyone know of a java class parser that can be used to > > > do this sort > > > of thing? Thoughts or ideas? Thanks! > > > > > > -- > > > Benson Chen > > > Director of Software Engineering > > > Porivo Technologies, Inc. > > > Phone: (919)806-0566x12 > > > E-Mail: [EMAIL PROTECTED] > > > "Measuring end-to-end Web performance" > > > > > > > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > For additional commands, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > > > > > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > For additional commands, e-mail: > > > <mailto:[EMAIL PROTECTED]> > > > > > > > <font size="1">Confidentiality Warning: This e-mail contains information > > intended only for the use of the individual or entity named above. If the > > reader of this e-mail is not the intended recipient or the employee or > agent > > responsible for delivering it to the intended recipient, any > dissemination, > > publication or copying of this e-mail is strictly prohibited. The sender > > does not accept any responsibility for any loss, disruption or damage to > > your data or computer system that may occur while using data contained in, > > or transmitted with, this e-mail. If you have received this e-mail in > > error, please immediately notify us by return e-mail. Thank you. > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > -- > Benson Chen > Director of Software Engineering > Porivo Technologies, Inc. > Phone: (919)806-0566x12 > E-Mail: [EMAIL PROTECTED] > "Measuring end-to-end Web performance" > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- Benson Chen Director of Software Engineering Porivo Technologies, Inc. Phone: (919)806-0566x12 E-Mail: [EMAIL PROTECTED] "Measuring end-to-end Web performance" -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>