Question

I would like to take some action when tomcat service is going down. For example, I would like to simply log the stop time of the tomcat service. Is there any way to do this by applying hooks to tomcat lifecycle event ? If yes, then please provide some details.
I would like to call one class when tomcat is going down and this class will log the time in some property file.

Thanks.

Was it helpful?

Solution

You have to implement interface org.apache.catalina.LifecycleListener and then register it in your tomcat configuration.. You may find how in this document in section Lifecycle Listeners.

Hope this helps you..

edit: changed URL to correct document ;-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top