View Pack container logs
The Logs page streams output from a Pack's containers. Select a workload, pod, and container to choose the source. You can also follow several containers at the same time.
This page is not a permanent log archive. It reads output available for the container's current run. Earlier lines may no longer be available after the container restarts, the pod is deleted, its logs rotate, or the Kubernetes retention period ends.
Prerequisites and confidentiality
The Pack must have at least one available pod and container, and your role must allow you to view the project and Pack. If the Pack has not created a workload yet, or its pod is not running, the source lists may be incomplete.
Application logs can contain passwords, tokens, personal information, or customer data. Check the output before copying, saving, or sharing it, and do not paste sensitive values into public tickets or messages.
Open Logs
From the Pack sidebar, select Logs. You can also select the Show log icon for a workload or pod on the Workloads page. The Logs page then opens with that source selected.
When you open the page directly, the panel selects the first available workload and all of its pods and containers, then connects automatically. If you used a pod shortcut, the initial selection is limited to that pod.
Select log sources
To change the source, select Disconnect first. The filters are disabled while the stream is connected. Then choose the sources in this order:
- Select one or more items from Workload.
- Select the corresponding items from Pod.
- Select the required items from Container.
Changing the workload clears the pod and container selections. Changing the pod clears the container selection. This prevents the next connection from using sources that no longer match. To follow every item in the current list, select Select all.
If the page opens without a valid source, the panel selects the first workload and all of its pods and containers. After choosing the filters, select Connect.
The sources for each stream are fixed when the connection starts. If Kubernetes replaces a pod while you are connected, the panel does not automatically open a stream for the replacement. Disconnect, select the current pod and container, and connect again.
Choose where the log stream starts
Use Show the last to choose how much existing output the panel retrieves when it connects. The current options are 10 Lines, 100 Lines, 1000 Lines, 1 Minute, 30 Minutes, 1 Hour, and 12 Hours. The default is 100 Lines.
After loading the initial output, the panel appends new lines until you disconnect. When several containers are selected, their output appears in one view. Enable pod and container names to identify the source of each line.
Log display controls
The bar below the viewer shows the connection status and these controls:
- Wrap lines: wraps long lines to the width of the viewer. When disabled, scroll horizontally to read the rest of a long line.
- Show Time: displays a time next to each line. If the line has no recognizable timestamp, the panel shows when it received the line. For precise time analysis, the application should write timestamps in its output.
- Show pod names and Show container names: identify the source of each line, which is useful for a stream with several sources.
- Auto scroll: moves to the latest output when a new line arrives. This option is enabled when the page opens.
- Clear screen: removes lines from the browser view only. It does not delete container logs or any cluster data.
To choose another source or starting point, select Disconnect, change the filters, and select Connect again. A new connection clears the previous output from the viewer.
The viewer also renders ANSI color and formatting codes in the output. This formatting only changes the appearance of the logs and is not one of the panel controls.
Use the kubectl command
When exactly one pod is selected, the panel displays a kubectl logs command for the selected namespace, pod, and container at the bottom of the page. Run it only in an environment where kubectl is configured for the same cluster.
Use the copy icon in the command box to copy it. Copying the command does not run it.
The command field is disabled when several pods are selected. With several containers, the command may use --all-containers or show a container placeholder. Check the pod and container names before running it. The command reflects the selected source, but does not include the panel's display controls.
Common problems
The filters cannot be changed
The workload, pod, container, and starting-point filters remain disabled while the stream is connected or connecting. Select Disconnect, change the selections, and connect again.
No log lines appear
Check that the selected container is running and producing output. Then choose a longer period or a larger line count. You can inspect the pod on the Workloads page and check image-pull or scheduling errors in Pack events.
The server stops the stream
The pod may have been replaced or deleted, the network connection may have closed, or the container's log stream may have ended. Disconnect, review the pod list, and connect to the current pod. If the problem continues, check the workload status and Pack events.
The source of each line is unclear
When following several pods or containers, enable Show pod names and Show container names. To focus on one source, disconnect and select only that pod and container.