Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

log4j jdbc appender

843859Aug 5 2009 — edited Nov 20 2014
Hi,

I have configured the log4j.properties file and I am able to log to the database. I was wondering if there was a way to log two different messages to two different columns in a single row.

For example, assume I have the following sql in my configuration file:
               log4j.appender.jdbc.sql=INSERT INTO my_logger (company_name, end_timestamp, job_name) VALUES ('%m', '%d{yyyy-MM-dd HH:mm:ss.SSSSSS}', '%m')
     
Also assume I have this call in my main class:
              jdbcLogger.info("someMSG");
     
What i want is to be able to log two seperate messages for company_name and job_name.
company_name                  end_timestamp                       job_name
someCompany            2009-06-03 15:32:12.000113                 someJob
Is that possible?

I would appreciate any help you may be able to provide.

Thanks,

Jagara
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2009
Added on Aug 5 2009
4 comments
791 views