How to Read Previous Container Logs After a Kubernetes Crash
Read a restarted container’s previous run in WatchLog and match its last lines to Kubernetes events without assuming those logs are retained.
A pod restarted at 03:14, but the current container log begins with a normal startup. That is the replacement process talking. To see the failure that preceded the restart, look at the previous run of the right container, then compare the evidence with the restart and its events.
Open the affected pod and pick the right container
Start from the alert or the Kubernetes workload page. Check the namespace and pod, and use the restart count and termination details to identify the container that exited. In the pod’s Logs panel, choose the container if the pod has several, enable Previous run, and click Show last lines. Enable Times to line up the entries with pod events. A sidecar’s previous log will not show the app’s last error.
In the WatchLog demo, the legacy-importer pod’s importer container is in CrashLoopBackOff and last exited with code 1. The previous run reads the config path, then reports that the file was not found.

Compare the last lines with the exit and restart
Compare the most recent log timestamps with the container’s last termination, restart and the alert. In the importer example, the missing file points you to the configured path or volume mount; the log does not prove which is wrong. If instead the log stops abruptly alongside an OOMKilled reason, start with the memory limit and recent usage. A warning by itself is not a cause, and the absence of a final error line does not rule out a forced termination. In a rapid crash loop, match the timestamps of the run you are actually reading to pod history.
Know where Previous run applies
Kubernetes: WatchLog reads the previous instance of the selected container through the Kubernetes API, if its log is still available. It cannot retrieve a removed pod’s history. Docker: a stopped container’s log is readable while Docker keeps that container and uses a supported driver; there is no separate Previous run control. Linux: read the systemd service journal or the PM2 or supervisord logs on the service page. Those are not split by a Previous run toggle.
Check permissions and avoid assuming log retention
The UI defaults to 200 lines. The MCP container logs response is separately capped at 200 lines and 16 KB. WatchLog requests the lines from the agent and does not store them. If a teammate cannot open the panel, check whether the organization restricts access or the agent disables log reads. The agent masks common credential patterns, but redaction is not exhaustive. Review lines before sharing them and use a separate log store when you need historical or cross-container search.
Try the public demo: choose sample-cluster → Workloads → legacy-importer and open its pod. See Logs on demand coverage and limits or the guide to checking the evidence behind an alert.