tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject RE: Asynchronous statistics logger
Date Thu, 02 Dec 2004 10:10:44 GMT
this strikes me as being something JMS would handle well, but Tomcat doesn't support JMS by
default. I have seen people installing openJMS on Tomcat though.

as for the startup/shutdown, that's going to be a Context Listener you want to implement and
add to web.xml with <listener>.

that's about all i can offer on this, sorry :)

> -----Original Message-----
> From: Michael Cornell [mailto:michael.cornell@estafet.com]
> Sent: 02 December 2004 10:04
> To: tomcat-user@jakarta.apache.org
> Subject: Asynchronous statistics logger 
> 
> 
> Hi,
> 
> I am trying to implement an asynchronous statistics logger 
> that would load
> on startup and be destroyed on shutdown of tomcat.  This 
> logger then needs
> to write to a log file / to disk / to log4j every x seconds with these
> statistics.
> 
> Methods to add some statistic to it need to be accessible by all other
> classes in the same context (eg public static void addPageHit(String
> whatPage, int howBigWasIt); )
> 
> I have already tried writing an asynchronous Singleton, but 
> this has caused
> major havoc with threading issues (jdk1.4.2 tomcat 5.0.25 
> redhat linux 9.0).
> In addition I know this is not good practice.  This singleton 
> was using the
> Timer and TimerTask for its implementation.
> 
> What is the best practice for implementing this sort of class ?
> 
> Thanks
>  Michael
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.788 / Virus Database: 533 - Release Date: 01/11/2004
> 


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message