Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4j help

 
gurudev jai
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to get serious with log4j get the complete log4j manual
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic