esuslogo
 [To advertise Java(tm) Events here, contact joris@esus.com!]
banner

Java™
by example!






New @ Esus.com


  gb  In-house search engine for better results!

  gb  Get updates with the esus.com
newsletter!









  Home 
 Browse Categories 
 Ask a Java Question 
 Help 
  For Java Tips & Tricks, subscribe to the esus.com newsletter!
Search Java Q&A, Links, API's:   adv 

How do I log strings or exceptions to my JSP engine?
The HttpServlet class extends from the GenericServlet superclass. This latter has two useful log methods:

 
This code sample is only viewable to esus.com members
Login or become a member!


You can use these methods to write messages to the logs of your JSP/Servlet engine (they implement it all differently).
For example, the following JSP

 
This code sample is only viewable to esus.com members
Login or become a member!


logged the following in my current log file catalina_log.2003-04-01.txt:

 
This code sample is only viewable to esus.com members
Login or become a member!


Look at the Tomcat category or documentation to see how you can change the file you want to log to.


Further Information
Author of answer: Joris Van den Bogaert

Comments to this answer are only viewable by members. Login or become a member!





Terms of Service | Privacy Policy | Contact

Copyright © 2000-2003 Esus.com - All Rights Reserved 
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. Esus.com is independent of Sun Microsystems, Inc. All other trademarks are the sole property of their respective owners.