It's possible.  You need to create a log4j.xml config file that contains both a 
LogFilePatternReceiver entry and a JDBCAppender entry.

Once you have the xml config file, you need a program that will initialize this 
configuration (your app won't be generating events, just the receiver).

You can use SimpleSocketServer for this purpose (something to hang the log4j 
configuration off of) or write your own program.  You could also use Chainsaw 
(allowing any event Chainsaw sees to end up in a database).

You'll probably want to filter out the org.apache classes in your appender 
config (or delete them from the db when you've loaded all of the events).

Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR  97201

Telephone:      503.224.7496
Cell:           503.997.1367
Fax:            503.222.0185

[EMAIL PROTECTED]

www.comotivsystems.com



-----Original Message-----
From: ying lcs [mailto:[EMAIL PROTECTED]
Sent: Thu 10/26/2006 11:07 PM
To: [email protected]
Subject: How to write log using jdbc appender
 
hi,

Log4j has a jdbc appender. But can i just queue up all the log entries
to the disk first. And at the end of the day everyday, It writes to
the Database?

Thank you.

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



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

Reply via email to