You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ken Keller <kk...@ign.com> on 2003/01/05 00:39:47 UTC

bracketing (begin/end) methods

Has anybody pointed out the logging APIs don't seem to have a notion of method/event bracketing as in:
event = log.begin();
try {
  ...
  event.end();
}
catch (Exception e) {
  event.catch(e);
  ...
}

Without this, I can't analyze the log for unmatched begin/end, run-times, etc. I can't match an exception to an event. Am I missing something? Would anybody else be interested in this feature? Thx. -Ken

Re: bracketing (begin/end) methods

Posted by Stefan Bayer <ma...@sbayer.de>.
Shouldn't you put event.end() inside finally{..} to prevent unmatched 
begin() statements?

At 00:39 05.01.2003, you wrote:
>Has anybody pointed out the logging APIs don't seem to have a notion of 
>method/event bracketing as in:
>event = log.begin();
>try {
>   ...
>   event.end();
>}
>catch (Exception e) {
>   event.catch(e);
>   ...
>}
>
>Without this, I can't analyze the log for unmatched begin/end, run-times, 
>etc. I can't match an exception to an event. Am I missing something? Would 
>anybody else be interested in this feature? Thx. -Ken


ByTek - Stefan Bayer
Softwaresysteme


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>