LogEvents don't have fields for those items, and the JDBCAppender logs 
LogEvent objects.  So you'll have to do some coding.
A couple options off the top of my hand:
1) extend PatternLayout with conversion characters for all those things
2) override getLogStatement(...) in JDBCAppender.  
3) create your log message specifically for logging to the db, with 
commas and such embedded.  Then tell the JDBCAppender to insert just the 
message.
    example:  log.info(" 'empABC', 'sessionABC', 'John', 'transABC', 
'2002-07-23', 5, 'Result' ");
    config:  log4j.myjdbcappender.sql = insert into logMessage (Emp_id, 
Session_id, ...) values (%m)

Kevin

Narayanan, Shiva (MED, Compuware) wrote:

>Hello All,
>We have the following requirements. We have a table called "logMessage"
>in Oracle.
>
>Fields in the table are 
>    Emp_id --> Char data type
>    Session_id --> Char data type
>    Emp_name       --> Char data type
>    Transaction_type--> Char data type
>    Transaction_timestamp --> Date data type
>    Result_code  --> Number data type
>    Result_description --> Char data type
>
>We need to log messages to the above table whenever a transaction is
>complete. 
>How do we have to setup JDBCAppender to achieve this?
>
>Many thanks,
>Shiva
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



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

Reply via email to