logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amit Oberoi" <aobe...@TechMahindra.com>
Subject Issue with IDField in CustomSQLDBReceiver
Date Thu, 07 Jul 2011 15:14:04 GMT
All,

 

I am using the latest developer snapshot 2.0.1 for Chainsaw V2. I have
configured CustomSQLDBReceiver with My SQL server.

 

My problem is every time the receiver refreshes it gets all the logs in
the database instead of the new ones. Probably it is ignoring the
IDField param for SQL.   

 

It is apparently looking at the IDField because it complains if I don't
set it or have it set to a field that is not a number; however, it is
not using it in the sql.

 

Can anyone help in sorting this out; I'll be happy to debug and work on
a patch in case someone points me to the code.

 

Below is my table schema and receiver configuration.

 

Table Schema:

 

+------------------+-----------------+---------+---------+--------------
-----------------------+---------------------------------------------+

| Field                    | Type                  | Null     | Key
| Default                                              | Extra
|

+------------------+-----------------+---------+---------+--------------
-----------------------+---------------------------------------------+

| COUNTER         | int(11)               | NO      | PRI      | NULL
| auto_increment                                           |

| TIMESTAMP    | timestamp       | NO      |              |
CURRENT_TIMESTAMP              | on update CURRENT_TIMESTAMP        |

| THREAD            | varchar(255)  | YES      |              | NULL
|
|

| CLASS                | varchar(255)  | YES      |              | NULL
|
|

| METHOD          | varchar(100)  | YES      |              | NULL
|
|

| FILE                     | varchar(100)  | YES      |              |
NULL                                                  |
|

| LINE                    | int(11)               | YES      |
| NULL                                                  |
|

| PRIORITY          | varchar(50)      | YES      |              | NULL
|
|

| LOGGER            | varchar(255)  | NO      |              | NULL
|
|

| MESSAGE         | varchar(1000) | NO      |              | NULL
|
|

| NDC                    | varchar(255)  | YES      |              |
NULL                                                  |
|

| MDC                   | varchar(255)  | YES      |              | NULL
|
|

+------------------+-----------------+---------+---------+--------------
-----------------------+---------------------------------------------+

 

Receiver Configuration:

 

<plugin class="org.apache.log4j.db.CustomSQLDBReceiver" name="Receiver">

       <param name="active" value="true" />

       <connectionSource
class="org.apache.log4j.db.DriverManagerConnectionSource">

            <param name="user" value="user1"/>

            <param name="password" value="passwd"/>

            <param name="driverClass" value="org.gjt.mm.mysql.Driver"/>

            <param name="url"
value="jdbc:mysql://10.2.21.127:3306/Logs"/>

       </connectionSource>

       <param name="refreshMillis" value="5000"/>

      <param name="sql" value='select logger as LOGGER, timestamp as
TIMESTAMP, priority as LEVEL, thread as THREAD, message as MESSAGE, ndc
as NDC, mdc as MDC, class as CLASS, method as METHOD, file as FILE, line
as LINE, concat("{{application,databaselogs,hostname,mymachine,
log4jid,", COUNTER,"}}") as PROPERTIES, "" as THROWABLE from logs'/>

       <param name="IDField" value="COUNTER"/>

       <param name="threshold" value="ALL" />

   </plugin>

 

 

 

Regards

 

Amit Oberoi

 


============================================================================================================================Disclaimer:
 This message and the information contained herein is proprietary and confidential and subject
to the Tech Mahindra policy statement, you may review the policy at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a>
externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a>
internally within Tech Mahindra.============================================================================================================================

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message