tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leon Rosenberg" <rosenberg.l...@googlemail.com>
Subject Re: timestamp of tomcat startup?
Date Fri, 05 Jan 2007 23:37:54 GMT
Are you interesting in tomcat itself or in your webapp?
If later is the case you can simply write a ContextListener:

public class TimestampContextListener implements ServletContextListener{

        private static long startTimestamp;
	
	public void contextDestroyed(ServletContextEvent event) {
	}

	public void contextInitialized(ServletContextEvent event) {
              startTimestamp = System.currentTimeMillis();
	}

        public long getStartTimestamp(){ return startTimestamp; }
}

alternatively you could put the very same timestamp into
servletContext (application scope) in the init() method of one of your
servlets.


regards
Leon
On 1/6/07, Caldarale, Charles R <Chuck.Caldarale@unisys.com> wrote:
> > From: cifroes [mailto:cifroes@netcabo.pt]
> > Subject: timestamp of tomcat startup?
> >
> > Is there a easy way to get this timestamp without modifying tomcat
> > source code?
>
> The message is logged by org/apache/catalina/startup/Catalina.java, but
> it does not appear to save the time value anywhere.  I suppose you could
> scan the log, looking for that particular message, but that's not
> exactly an elegant solution.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message