Using Log4J

You will want to generate log messages, both for debugging and to report state during the operation of the Web site. You should standardize this, too; otherwise, everyone will end up placing System.out.printlns all over the code, and you'll have a nightmare of a time cleaning them up later. The Apache folks have a nifty little (actually, fairly robust) logging package called Log4J (that's log for Java, get it?)

Log4J is easy to use but a bit tricky to configure. In the examples throughout the book, you will be using it in a fairly simple fashion, but it's worth taking about its full capabilities.

After installing Log4J using the instructions in Appendix C,you need to configure it for your application, just as Turbine needed to be ...

Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.