Timestamps

Timestamps are also available for the log output, although not by default. You can get the log messages prefixed by a timestamp by adding the --timestamps option. For example:

kubectl logs deployment/flask --timestamps

You then may see the following:

2017-09-16T03:54:20.851827407Z  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)2017-09-16T03:54:20.852424207Z  * Restarting with stat2017-09-16T03:54:21.163624707Z  * Debugger is active!2017-09-16T03:54:21.165358607Z  * Debugger PIN: 996-805-904

It is worthwhile to note that the timestamps are from the hosts that are running the containers, not your local machine, so the time zone on those logs will often not be the same time zone in which you reside. The timestamps all include ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.