This section describes how to query container logs.

Container logs: Logs obtained from the standard output of containers. The content of container logs is determined by the applications running in the containers.

KubeSphere supports querying container logs within the user’s permission scope, whether as a regular user or a cluster administrator.

Query Logs as a Regular User

Prerequisites

The WizTelemetry Logging extension must be installed and enabled on the KubeSphere platform.

Query Container Logs

  1. Log in to the KubeSphere web console.

  2. Click Component Dock > WizTelemetry Observability Platform.

  3. Click Logging > Log Query in the left navigation pane.

  4. On the Log Query page, set search criteria to query logs.

    • If there are multiple clusters, click the Cluster dropdown list to query logs in a specific cluster.

    • Click the search box, set search criteria, and then press Enter to view logs that meet specific conditions. You can set multiple search criteria simultaneously.

    • On the query results page, you can view the time distribution chart of the logs. Click on the histogram to switch to the log list for that time period. Click start-dark/stop-dark-white to start/stop real-time data refresh. Click the Log Export dropdown list to choose to export container logs in ascending or descending order. Click the time under Refresh Frequency to select the data refresh frequency.

    • Click cogwheel in the upper right corner of the query results list to customize the information displayed in the list.

    • Click a log entry in the query results to view detailed information about the log.

Query Logs as a Cluster Administrator

Prerequisites

  • You need to join a cluster and have the cluster-admin permission in the cluster. For more information, see Cluster Members and Cluster Roles.

  • The WizTelemetry Logging extension must be installed and enabled on the KubeSphere platform.

Query Container Logs

  1. Log in to the KubeSphere web console with a user who has cluster-admin permissions and enter your cluster.

  2. Click Logging > Log Query in the left navigation pane.

  3. On the Log Query page, set search criteria to query logs.

Query Calico Logs

The "WizTelemetry Logging" extension collects Calico logs by default, including Calico pod IP allocation and release information. You can limit the search criteria to query Calico logs.

On the Log Query page, set the following search criteria to query Calico logs.

Project: kube-system
Pod: <node name>
Container: calico-cni