Can we get the number of hits to a servlet using log4j
Hi, Is there any way we can find the number of hits to the servlet using log4j Thanks Srividya -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Can we get the number of hits to a servlet using log4j
Hi, In the service() method: logger.info(MyServlet: I'm hit! Help!); Or just do it the normal way, using the server's access file. You don't want to go down the path of using log4j to record access. Your web server should have ample provisions for this task. Yoav Shapira Millennium ChemInformatics -Original Message- From: Vullanki, Srividya [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 31, 2002 1:46 PM To: 'Log4J Users List' Cc: Bladon, Jeff Subject: Can we get the number of hits to a servlet using log4j Hi, Is there any way we can find the number of hits to the servlet using log4j Thanks Srividya -- To unsubscribe, e-mail: mailto:log4j-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:log4j-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Can we get the number of hits to a servlet using log4j
On Wed, 31 Jul 2002, Vullanki, Srividya wrote: Hi, Is there any way we can find the number of hits to the servlet using log4j In 'jakarta-log4j-1.2.5/examples' are two files: MyPatternLayout.java MyPatternParser.java They show an example on how to add a internal counter which is triggered every time this logging event is invoked. It solves exactly your whish. A few month ago I extended this example to have colored output of different logLevels on ConsoleAppender, see the list archive for a code example. Thanks Srividya -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] regards Heinrich -- http://www.xmlBlaster.org -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]