wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes Log4j help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4j help" Watch "Log4j help" New topic
Author

Log4j help

gurudev jai
Greenhorn

Joined: Oct 21, 2004
Posts: 2
Hi,

Any body help me

i am developing Framework for my project.My requirement is logging and Audting.My doubt:is it possible to sent some log messages to database and some log messages to file using same properties file
Can anybody help me how to do..it is helpful to sent code for that.


thanks


Regards

gurudev
Pavan Panduga
Ranch Hand

Joined: Jun 12, 2002
Posts: 68
Gurudev,

Yes, it is possible to send log messages to more than one destination. You have to configure appropriate Appenders in the log4j configuration file and you'll be all set.

In the Log4J distribution there's an example to show multiple destination configurations, It is configured to send messages to a File and GUI at the same time. So you may want to look for examples to look for JDBCAppenders.

Hope this helps,
Pavan
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
If you want to get serious with log4j get the complete log4j manual


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Log4j help