• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java 5 logging in JSPs and Tomcat

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic