logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: LoggingEvent.locationInfo
Date Tue, 04 Nov 2003 09:26:58 GMT
At 09:16 AM 11/4/2003 +0200, you wrote:
>Looking at the source of the LoggingEvent class I see that the
>getLocationInformation() method creates a new LocationInfo object using
>a new Throwable, and not the throwable that might be referenced by the
>LoggingEvent's member throwableInfo.  Considering that the LocationInfo
>class searches the Throwable to obtain the location information when it
>gets instantiated, I do not understand how it ever gets the location
>information, because the throwable created by getLocationInfo() is
>always empty?
>I must be missing something....  can somebody point out to me what,

Hello Andreas,

Here is the getLocationInformation method in LoggingEvent:

    * Set the location information for this logging event. The collected
    * information is cached for future use.
   public LocationInfo getLocationInformation() {
     if (locationInfo == null) {
       locationInfo = new LocationInfo(new Throwable(), fqnOfCategoryClass);

     return locationInfo;

The new Throwable contains the stack information. It does not need to have 
a message, we are only interested in the stack info. Does that make sense?

>Thank you
>Andreas Bothner
>Systems Integrator
>Mobile Telephone Networks - Information Systems

Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp

      import org.apache.Facetime;
      ApacheCon US 2003, 18-21 November http://apachecon.com/

To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org

View raw message