Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to write a class to log statistics?  RSS feed

 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have hired some web space to host my servlets. I need access to the access_log files, but the hosting company won't grant me this.

Instead, they have suggested I 'write/upload a class to log statistics'.

Does anyone know how I can do this to obtain the information that is held in the access_log files? (But as I have described in my other recent post I am having problems with my servlets writing to text files.)

Many thanks,
James
 
Scott Dunbar
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your provider allow you to install a Filter (and, by extension, are they using a 2.3 Servlet container)?

If so, you could easily log everything you want via a Filter. I responded to your other post with a possible solution to help with the log file.

If you are either not on a 2.3 Servlet spec container or your provider won't let you install a Filter, I might have a "central" servlet that logs and then forwards to any other servlets based on some of parameter or configuration. Think of it as the struts ActionServlet that is kind of a request distributor.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!