Here's the data.  In the properties, there is a log4j_id followed by the 
unique id for the log entry.  I get new events, however, I get the same 
events multiple times.  There are only 5 entries in the log table. 
Chainsaw loads the same events over and over.  It seems to be an endless 
loop.

--------------------------------------------
LINE    LEVEL   MESSAGE         FILE THREAD     TIMESTAMP
371     INFO     Invalid session /home/guest/bin/../lib/Login.pm   
09/21/2006 18:19:32
137     INFO    load_records initialized 
/home/guest/bin/../lib/ParseData.pm                             09/21/2006 
18:19:41
31      INFO    load_data initialized   /home/guest/bin/load_data   
09/21/2006 18:20:48
2       INFO    Retrieving records      /home/guest/bin/load_data   
09/21/2006 18:21:24
2       INFO    processing data /home/guest/bin/load_data  09/21/2006 
18:21:39



NDC     MDC     CLASS   METHOD  PROPERTIES 
 
{{application,load_records,hostname,localhost,USERID,guest,log4j_id,20534929}} 
 
{{application,load_records,hostname,localhost,USERID,guest,log4j_id,20534930}}
 
{{application,load_data,hostname,localhost,USERID,guest,log4j_id,20534931}}
 
{{application,load_data,hostname,localhost,USERID,guest,log4j_id,20534932}}
 
{{application,load_data,hostname,localhost,USERID,guest,log4j_id,20534933}} 
 
EXCEPTION       LOGGER
                Log::Log4perl
                Log::Log4perl
                Log::Log4perl
                Log::Log4perl
                Log::Log4perl

---------------------------------------------------

Here also is the sql that is executed:

SELECT line as LINE, log_level as "LEVEL", message as MESSAGE, src_file as 
"FILE", stack as THREAD, log_time as TIMESTAMP, '' AS NDC, '' AS MDC, '' 
AS CLASS, '' AS METHOD, 
CONCAT('{{application,'||application||',hostname,'||hostname||',USERID,'||USER_ID||',log4j_id,'||log_id||'}}','')
 
AS PROPERTIES, '' AS EXCEPTION, 'Log::Log4perl' AS LOGGER from log





"Scott Deboy" <[EMAIL PROTECTED]>
09/22/2006 09:42 AM
Please respond to "Log4J Users List"
 
        To:     "Log4J Users List" <[email protected]>
        cc: 
        Subject:        RE: chainsaw events not being received


If you can provide the text of a couple of your retrieved rows, that'd be 
helpful - the images didn't come through in the last message.

In order to control which events are retrieved, you need to do two things:
1. Define the IDField param as the column name that is an int incremental 
unique identifier for the row in your schema representing a logging event.
2. Ensure there is a 'log4jid' property, followed by a comma, followed by 
the value of the column defined as the IDField column.
3. Ensure all properties are comma separated, even if there is more than 
one name/value pair, and that the properties are enclosed by two braces on 
each end.

For example, if a column named log_id was the unique identifier for a 
logging event row, 'log_id' should be the value for the IDField param. The 
value for the log_id column should be in the 'properties' in the resulting 
SQL - as the value of the log4jid property.
The 'properties' column in the retrieved SQL should look like this:
{{log4jid,45}}
{{log4jid,46}}

If there were two properties (hostname=localhost and log4jid=value of 
log_id column) being added to each event, the 'properties' column in the 
retrieved SQL should look like this:
{{hostname,localhost,log4jid,45}}
{{hostname,localhost,log4jid,46}}

If you get the SQL right, the receiver will behave as you expect.

Scott Deboy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thu 9/21/2006 3:35 PM
To: Log4J Users List
Subject: RE: chainsaw events not being received
 
I found part of the problem.  I did not have an underscore in log4j_id (I 
just had log4jid).  When I changed that, I started getting new events. 
However, I am getting duplicate events many times.  Any thoughts on that?

Here's the data.  I changed some data due to security issues.  I didn't 
change the log4j_id though. 














"Scott Deboy" <[EMAIL PROTECTED]>
09/21/2006 05:47 PM
Please respond to "Log4J Users List"
 
        To:     "Log4J Users List" <[email protected]>
        cc: 
        Subject:        RE: chainsaw events not being received


To be able to continually retrieve newly-inserted rows, you need a
property named 'log4j_id' in the 'properties' column.  The value after
log4j_id should be the value in the column represented by the IDField
param.

Can you run the sql query and provide a couple of rows?  I'd like to see
the string returned as the properties column.

Scott Deboy


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 21, 2006 12:22 PM
To: [email protected]
Subject: chainsaw events not being received

Hi,

I am using chainsaw with CustomSQLDBReceiver.  When I launch chainsaw,
the 
receiver is started and I see events.  However, I am not receiving any
new 
events.  Do you have any thoughts on why?

Below is my configuration file. (For obvious reasons, I did not include
my 
real password, user name, etc).

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration >
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/";>
   <plugin name="MyCustomDBReceiver" 
class="org.apache.log4j.db.CustomSQLDBReceiver">
      <connectionSource 
class="org.apache.log4j.db.DriverManagerConnectionSource">
        <param name="driverClass" 
value="oracle.jdbc.driver.OracleDriver"/>
        <param name="password" value="blah"/>
        <param name="user" value="user"/>
        <param name="url" value="jdbc:oracle:thin:@blah:1521:brewu"/>
      </connectionSource>
     <param name="IDField" value="log_id"/>
     <param name="refreshMillis" value="3000"/>
     <param name="sql" value="SELECT line as LINE, log_level as 
&quot;LEVEL&quot;, message as MESSAGE, src_file as &quot;FILE&quot;,
stack 
as THREAD, log_time as TIMESTAMP, '' AS NDC, '' AS MDC, application AS 
CLASS, '' AS METHOD, 
CONCAT('{{application,'||user_id||',hostname,'||hostname||',USERID,'||US
ER_ID||',log4jid,'||log_id||'}}','') 
AS PROPERTIES, '' AS EXCEPTION, 'Log::Log4perl' AS LOGGER from bu_log"/>
   </plugin>
   <root>
      <level value="DEBUG"/>
   </root>
</log4j:configuration>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-----------------------------------------
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law.  If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED.  Although this transmission and
any attachments are believed to be free of any virus or other
defect that might affect any computer system into which it is
received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as
applicable, for any loss or damage arising in any way from its use.
If you received this transmission in error, please immediately
contact the sender and destroy the material in its entirety,
whether in electronic or hard copy format. Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to