Results 1 to 4 of 4
Thread: Log4J JDBCAppender
- 02-24-2011, 06:52 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 2
- Rep Power
- 0
Log4J JDBCAppender
I have a log4j.properties where i am using JDBCAppender to log to the database:
log4j.appender.jdbc.sql=insert into invocation_count (invocation_time, facade_id) values ('%d{yyyy-MM-dd HH:mm:ss}','%m')
when i do log.debug("msg");
the datetime and message value are inserted to the database table.
is there any way to to have the sql as :
insert into cpm_invocation_count (invocation_time, facade_id, first_name, last_name) values ('%d{yyyy-MM-dd HH:mm:ss}','%m', '%m', '%m')
so that i can log multiple messages into database multiple columns.
Thanks & Regards,
Subhasish MohantyLast edited by Subhasish Mohanty; 02-24-2011 at 06:56 AM. Reason: missed
- 02-25-2011, 06:49 PM #2
Senior Member
- Join Date
- Nov 2010
- Location
- Delhi
- Posts
- 135
- Blog Entries
- 1
- Rep Power
- 0
You can log the same message (i.e the single message which we usually pass to logger) any number of times in many columns. But, if you want multiple different messages in same row (in different columns), then log4j is not the solution.:(
You can gather more info on this by looking at the source of log4j's Logger class.
- 03-03-2011, 10:39 AM #3
Member
- Join Date
- Feb 2011
- Posts
- 2
- Rep Power
- 0
Log4J JDBCAppender
Thanks a lot
- 09-20-2011, 10:42 AM #4
Member
- Join Date
- Sep 2011
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
log4j
By haj1st in forum EclipseReplies: 5Last Post: 01-23-2011, 02:17 PM -
Problem on Log4j: How to include custom <filter/> into JBoss (log4j.xml)?
By holyjohn in forum Advanced JavaReplies: 1Last Post: 09-20-2010, 08:32 AM -
log4j
By swapna_d in forum New To JavaReplies: 7Last Post: 08-04-2010, 12:23 AM -
Regarding Log4j
By sidiq in forum New To JavaReplies: 0Last Post: 04-07-2008, 07:35 PM -
Log4j
By chakri in forum New To JavaReplies: 1Last Post: 02-08-2008, 10:15 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks