Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to Log Server Start/Stop time in Database
Use Case:
We want to Log Server Start/Stop time in database.
Example: for Normal Web-App we use
"ServletContextListener" which get triggered at server
start/stop and log time in DB.
Explanation:
I like to log server start/stop time,
do
Liferay has "ServletContextListener" like feature
OR
is there any Inbulit Method from where I can fetch the server start
and stop time
Hi ,
You can get the time when the Liferay was started from
PortalUtil.getUptime(). In case you need an event to capture this,
then you can look into the Global Start up event that runs once when
the portal initializes.
https://help.liferay.com/hc/en-us/articles/360035828151-Liferay-DXP-Startup-Phases#portal-startup-events
Thanks,
for the response, just curious to know do we have any
stop time as well,
Hi ,
You can capture that from Global Shut Down event , You can refer below property
Powered by Liferay™