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

Reply via email to