Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 58953 invoked from network); 2 Dec 2004 14:04:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Dec 2004 14:04:57 -0000 Received: (qmail 28728 invoked by uid 500); 2 Dec 2004 14:01:49 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 28715 invoked by uid 500); 2 Dec 2004 14:01:49 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 28701 invoked by uid 99); 2 Dec 2004 14:01:49 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from sid.armstrong.com (HELO sid.armstrong.com) (204.74.20.252) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 02 Dec 2004 06:01:47 -0800 Received: from [192.168.1.101] (pcp01470022pcs.lncstr01.pa.comcast.net [68.82.237.147]) by sid.armstrong.com (8.12.8p1/8.12.8) with ESMTP id iB2E1JTj011052 for ; Thu, 2 Dec 2004 09:01:19 -0500 Message-ID: <41AF2042.6060402@joedog.org> Date: Thu, 02 Dec 2004 09:01:38 -0500 From: Tim Funk Organization: Human being User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en, es-mx, de, sv MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Asynchronous statistics logger References: <5684A7E6FB10504393A2806C1F4C021005AF7F15@orion.qas.com> In-Reply-To: <5684A7E6FB10504393A2806C1F4C021005AF7F15@orion.qas.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I second using JMS. Having a JMS server "somewhere" and tomcat as a JMS client. Then all the events are sent to the JMS server. Then the server can decide to consume the messages on demand and log as needed. -Tim Allistair Crossley wrote: > 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 . > > 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 ? >> --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org