logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Deboy" <sde...@comotivsystems.com>
Subject RE: CustomSQLDBReceiver not working correctly. Where can I find the code for it?
Date Fri, 12 May 2006 20:57:17 GMT
Great!  

By the way, Chainsaw should handle sorting for you if you choose a sort
column - I think it sorts by default on the ID column (I was surprised
to hear you needed to sort your resultset - maybe with this change you
would no longer have to).

Scott

-----Original Message-----
From: Mostrom, Edward [mailto:edward.mostrom@eds.com] 
Sent: Friday, May 12, 2006 1:55 PM
To: Log4J Users List
Subject: RE: CustomSQLDBReceiver not working correctly. Where can I find
the code for it?


After getting the source and putting in debug statements I found the
problem.  The code is not trimming the properties value/pairs.  In my
sql I had:
 hostname, 116, log4jid,' || CAST(COUNTER AS varchar(255))

With the space before log4jid the program was comparing " log4jid" with
"log4jid" and claiming it was not a match.  When I removed the space
everything worked fine.


-----Original Message-----
From: Mostrom, Edward [mailto:edward.mostrom@eds.com] 
Sent: Friday, May 12, 2006 2:08 PM
To: Log4J Users List
Subject: RE: CustomSQLDBReceiver not working correctly. Where can I find
the code for it?


Thanks.  I did finally get it to sort by using a sub query.  In case
anyone is interested in how to set up a custom db receiver for Oracle
this is what I used.  It still gets everything on an update and not just
the new events so I'll look at the code and see why it might be doing
that.

<plugin name="MyDBReceiver"
class="org.apache.log4j.db.CustomSQLDBReceiver">
		<connectionSource
class="org.apache.log4j.db.DriverManagerConnectionSource">
        	<param name="password" value="<password>"/>
        	<param name="user" value="<id>"/>
        	<param name="driverClass"
value="oracle.jdbc.driver.OracleDriver"/>
        	<param name="url"
value="jdbc:oracle:thin:@<server>:<port>:<instance>"/>
		</connectionSource>
		<param name="refreshMillis" value="5000"/>

		<param name="sql" value="select * from (select counter
as counter, logger as LOGGER, date_stamp as &quot;TIMESTAMP&quot;,
priority as &quot;LEVEL&quot;, '-' as &quot;THREAD&quot;, message as
MESSAGE, '' as NDC, '' as MDC, '' as CLASS, '' as &quot;METHOD&quot;, ''
as &quot;FILE&quot;, '' as &quot;LINE&quot;, '{{application,
CiT,hostname, 116, log4jid,' || CAST(COUNTER AS varchar(255)) || '}}' as
&quot;PROPERTIES&quot;, 'host' as hostname, 'app' as application, '' as
&quot;EXCEPTION&quot; FROM LOG4J order by counter)"/> 
		<param name="IDField" value="COUNTER"/>
		<param name="refreshMillis" value="0"/>
		
</plugin>
 

-----Original Message-----
From: Scott Deboy [mailto:sdeboy@comotivsystems.com] 
Sent: Friday, May 12, 2006 1:55 PM
To: Log4J Users List
Subject: RE: CustomSQLDBReceiver not working correctly. Where can I find
the code for it?

The SVN repository was down for a couple of days.  Here's a link to the
latest revision of CustomSQLDBReceiver.  As always, patches are always
appreciated!

http://svn.apache.org/viewcvs.cgi/logging/log4j/trunk/src/java/org/apach
e/log4j/db/CustomSQLDBReceiver.java?view=markup

Scott

-----Original Message-----
From: Mostrom, Edward [mailto:edward.mostrom@eds.com] 
Sent: Wednesday, May 10, 2006 2:13 PM
To: log4j-user@logging.apache.org
Subject: CustomSQLDBReceiver not working correctly. Where can I find the
code for it?


I am using Chainsaw v2 alpha 1 connecting to an Oracle 10g database.

I am getting events back; but every time it refreshes it gets them all
again instead of just the new ones.  Looks like it is ignoring the
IDField param for the sql.

It is apparently looking at the IDField because it will complain if I
don't have it set or have it set to a field that is not a number... But
it is not using it in the sql.

It is also not sorting by that field so the events come back in a
strange order.

There are some other minor oddities - but I can live with them.

Is there any place where I can get the code for it so I can make one
that works for me?  Didn't see it anywhere in the svn depot.



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


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


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


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


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


Mime
View raw message