简体   繁体   中英

How to get the up time report for a Java Web Application deployed on Apache Tomcat 7?

How to get the up time report for a Java Web Application deployed on Apache Tomcat 7? By Up time I mean we have to show that Application is up and running. Is there any tomcat log by which we can show?

Inside your contextDestroyed:

System.err.println(" -- uptime was : -- " +
    org.apache.commons.lang.time.DurationFormatUtils.formatDurationISO(
        java.lang.management.ManagementFactory.getRuntimeMXBean().getUptime()
    )
);

In millis:

' -- uptime was : -- P0Y0M1D3H4M22.029S' Saying that, uptime was, 1 day 3 hours 4 minutes and 22 seconds briefly.

Hows that?

Yes, Tomcat generates the tomcat logs. Check under $TOMCAT_PATH\\logs folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM