Bob - > -----Original Message----- > From: Robert Pepersack [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 21, 2004 11:48 AM > To: Log4J Users List > Subject: RE: Exception Quandry
> rare events. I surround my info and debug logging requests with "if" > blocks to prevent them from being executed. This isn't really necessary - just use the set the log level on the appender to ERROR or higher. However, you can still take a hit during creation of method parameters to the log method. I think this is explained in the log4j FAQ. > Do you know of a way to get log4j's message (just the %m, %M, > and %C parts) > into my wrapper exception. I thought about putting this code into my > custom appender, but it is cumbersome and appenders are for logging > requests, not exception creation. It might help you to know that the way log4j gets the method and line numbers is to create a Throwable instance and then parse the stack trace (at least in 1.2.x - did you already look at the code?). I think filling the stack trace is the expensive operation. If you are using jdk 1.4 you can get at this information more easily, although I don't know the details. Hope that helps. Ken --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
