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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.