RE: when to log Exceptions

2004-03-16 Thread Simon Dorrat
> Where would you see as being the best place to log this > Exception? If it gets logged at the lowest layer (methodC), how does the > next layer up (methodB) know not to log it again, since it can't tell which > Exceptions it caused and which were thrown to it. And the same question

RE: when to log Exceptions

2004-03-16 Thread Lutz Michael
Good point, I agree with you. Btw it's really a coincidence for me that you're asking this question. I'm involved with some conversations about this very topic at a local university in PA where we're having a hard time finding "best practices" or "standards" in this realm (exception handling, e

RE: when to log Exceptions

2004-03-16 Thread Larry Young
Mike, Yes, I had thought of something quite similar to that approach. But instead of deciding to log by class type, I had planned on having a simple "boolean hasBeenLogged" in the base Exception class and my logging wrapper class would simply check that flag before doing any work, and

RE: when to log Exceptions

2004-03-16 Thread Lutz Michael
Interesting question, should result in some good conversation! One approach is to create your own exception type and if you catch that, you'll know somewhere below you logged it (by convention). If you catch a Java exception, you'll know it hasn't been logged yet. I'm interested to see what tr

when to log Exceptions

2004-03-16 Thread Larry Young
Hello all, This is not exactly a log4j-specific question, but I thought I would throw it out to this group to get your opinions. I have multiple layers in my web-based application, and each layer has the possibility of throwing exceptions. The question I'm struggling with is w

extending RollingFileAppender

2004-03-16 Thread Jalt One
Hello, I've never extended any of the Log4j classes before, although I've been using Log4j for more than 2 years now. I have this new requirement to roll logs based on size, but instead of rotating them as RollingFileAppender does, I should just append a timestamp to the rolled file and that's it.