logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject RE: cvs commit: logging-log4j/src/java/org/apache/log4j/db/dialec t mssql.sql
Date Thu, 20 May 2004 16:56:18 GMT
At 06:41 PM 5/20/2004, you wrote:

>How is it configured to not log that info (since it is supposed to be 
>expensive)?

Look at the code in DBAppender. It should make it clear.

>Also am I curious why you write "?" instead of just leaving it null.

That's because the locationInfo fiels in LoggingEvent is initialized 
lazily. If it's null and LocationEvent.getLocationInfo is invoked, then 
caller's location info will be extracted. By initializing it to a non-null 
value when persisting the event, we are making sure that it won't be 
mistakenly initialized for a "cold" event. (A cold event is an event which 
has been already retrieved from the db or some other persistent medium or 
deserialized from the network.)

Does that make sense?

>James Stauffer
>
>-----Original Message-----
>From: Ceki Gülcü [<mailto:ceki@qos.ch>mailto:ceki@qos.ch]
>Sent: Thursday, May 20, 2004 11:37 AM
>To: Log4J Developers List
>Subject: RE: cvs commit: logging-log4j/src/java/org/apache/log4j/db/dialec 
>t mssql.sql
>
>
>Indeed. If no location info is desired or unavailable, it will still be 
>written as "?".
>
>At 06:33 PM 5/20/2004, you wrote:
>
> >Why did you add them as non-null?  Will they always be written?
> >
> >James Stauffer
> >
> >-----Original Message-----
> >From: ceki@apache.org 
> [<<mailto:ceki@apache.org>mailto:ceki@apache.org>mailto:ceki@apache.org]
> >Sent: Thursday, May 20, 2004 11:19 AM
> >To: logging-log4j-cvs@apache.org
> >Subject: cvs commit: logging-log4j/src/java/org/apache/log4j/db/dialect
> >mssql.sql
> >
> >ceki        2004/05/20 09:19:01
> >
> >   Modified:    src/java/org/apache/log4j/db/dialect mssql.sql
> >   Log:
> >   Added necessary fields to support LocationInfo.
> >
> >   Revision  Changes    Path
> >   1.2       +4
> > -0      logging-log4j/src/java/org/apache/log4j/db/dialect/mssql.sql
> >
> >   Index: mssql.sql
> >   ===================================================================
> >   RCS file:
> > /home/cvs/logging-log4j/src/java/org/apache/log4j/db/dialect/mssql.sql,v
> >   retrieving revision 1.1
> >   retrieving revision 1.2
> >   diff -u -r1.1 -r1.2
> >   --- mssql.sql 18 May 2004 17:00:08 -0000      1.1
> >   +++ mssql.sql 20 May 2004 16:19:01 -0000      1.2
> >   @@ -17,6 +17,10 @@
> >        ndc               TEXT,
> >        thread_name       VARCHAR(254),
> >        reference_flag    SMALLINT,
> >   +    caller_filename   VARCHAR(254) NOT NULL,
> >   +    caller_class      VARCHAR(254) NOT NULL,
> >   +    caller_method     VARCHAR(254) NOT NULL,
> >   +    caller_line       CHAR(4) NOT NULL,
> >        event_id          INT NOT NULL identity,
> >        PRIMARY KEY(event_id)
> >      )
>
>--
>Ceki Gülcü
>
>       For log4j documentation consider "The complete log4j manual"
>       ISBN: 2970036908 
> <http://www.qos.ch/shop/products/clm_t.jsp>http://www.qos.ch/shop/products/clm_t.jsp

>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-dev-help@logging.apache.org

-- 
Ceki Gülcü

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



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


Mime
View raw message