log4cxx tutorial

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

log4cxx tutorial


Hi Guys, when I first started using log4cxx about a year ago I was stun by its unavailable and limited sample usage, had to filter through the log4j documentations and test and trial to find out the proper behavior. (I'm a copy&paste-first-ask-question-later person ;) .


I've put up a sample usage with a sample XML configuration file that demonstrate the following appender at:




   1. org.apache.log4j.ConsoleAppender

   2. org.apache.log4j.FileAppender

   3. org.apache.log4j.rolling.RollingFileAppender

   4. org.apache.log4j.RollingFileAppender

   5. org.apache.log4j.net.SMTPAppender

   6. org.apache.log4j.jdbc.JDBCAppender

   7. org.apache.log4j.net.XMLSocketAppender


Some people may prefer BasicConfigurator format, but I just think the DOMConfigurator format makes more sense to me : )


And of course, the credit are still to those who actually contribute to the log4cxx project, (I'm a copy&paste-first-ask-question-later kind of person remembered? ;) .