You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Ceki Gülcü <ce...@qos.ch> on 2002/03/29 14:19:12 UTC

Re: SetLocationInfoFilter, was: [SUBMIT] GenericMatchFilter.java; SetLocationInfoFilter.java

Hi Mark,

At 14:06 28.03.2002 -0800, Mark Womack wrote:
>I found that setting the LocationInfo for every event appended to a
>SocketAppender or SocketHubAppender was too expensive.  It really bogged
>down the system.  But while I don't need LocationInfo for all the events, I
>would like it for some.  There was no way to do this (that I could find),
>but these filters let me do it very easily and do it all from the
>configuration file.

Why do you think that calling getLocationInfo multiple times will cost more
than calling it just once?

The implementaiton of LoggingEvent.getLocationInformation is as follows:

   public
   LocationInfo getLocationInformation() {
     if(locationInfo == null) {
       locationInfo = new LocationInfo(new Throwable(), fqnOfCategoryClass);
     }
     return locationInfo;
   }

>Also, SetLocationInfoFilter allows the location info to
>be set without requiring the appender to support a setLocationInfo() method;
>it can all be done in the filters before it gets appended.

Not all appenders require the setLocationInfo method and its implementation
is rather trivial. On the other had, the idea of SetLocationInfoFilter is very
original. I'll include it in the contribs/MarkMomack/ directory.

--
Ceki
My link of the month: http://java.sun.com/aboutJava/standardization/


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