This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Java 5 logging in JSPs and Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Java 5 logging in JSPs and Tomcat" Watch "Java 5 logging in JSPs and Tomcat" New topic
Author

Java 5 logging in JSPs and Tomcat

Luanne Misquitta
Greenhorn

Joined: Mar 19, 2007
Posts: 1
Hi,

I'm using Java logging in my jsps running in a Tomcat container. However, I find that locks are not released soon enough and the number of log files quickly grows to 100 and stops (that's the max locks). The size of the log files is just 1 or 2 KB. Is there a way to control this?
I am using it this way:

Logger logger = Logger.getLogger("AjaxLogger");

Handler ajaxLog = null;
try {
ajaxLog = new FileHandler("%t/ajax%u.%g.log",true);
}
catch (IOException ioe) {
logger.severe("Could not create ajax log");
}
if (ajaxLog != null) {
logger.addHandler(ajaxLog);
String logMsg=request.getParameter("logMsg");
if(logMsg!=null) {
logger.info(logMsg);
}

}


Thanks
Luanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java 5 logging in JSPs and Tomcat
 
Similar Threads
java.util.logging
java.util.logging.Logger: outputs multiple similar lines
java.util.logging
junit asserts for log messages
Create user wise Log file.