Kubernetes for Developers
上QQ阅读APP看书,第一时间看更新

Previous logs

The logs are generally specific to an active container. However, there is a common need to see what might have been in the logs if a container fails, or perhaps if you rolled out an update and something didn't work as expected. Kubernetes maintains a reference to the previous container for any Pod (if it exists), so that you can get this information when you need it. You can do this with the -p option, as long as the logs are available to Kubernetes.