You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Vullanki, Srividya" <Sr...@coair.com> on 2002/07/31 19:45:41 UTC

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Can we get the number of hits to a servlet using log4j

Posted by Heinrich Götzger <go...@gmx.net>.
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:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
regards


Heinrich
--
http://www.xmlBlaster.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>