< img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=3131724&fmt=gif" />

Enable Collect Logs on Volumes

This section introduces how to enable collect logs on volumes when creating workloads, services, or Jobs. For more information, see Create a Workload or Create a Job.

Prerequisites

  • You should join a project and have the Application Workload Management permission within the project. For more information, refer to "Project Members" and "Project Roles".

  • WhizardTelemetry Logging should have been installed and enabled, and the log collection feature must be enabled in the project.

Steps

  1. Log in to the KubeSphere web console with a user who has the Application Workload Management permission, and access your project.

  2. In the left navigation pane, select Application Workloads > Workloads or Application Workloads > Jobs.

  3. On the workloads page, click Deploy, StatefulSet, or DaemonSet to open the workload list, or on the Jobs page, click Job or CronJob to open the Job list.

  4. Click Create on the page.

  5. On the Storage Settings tab, click the Collect Logs on Volumes switch to enable the feature.

  6. Click Mount Volume to mount a persistent volume or temporary volume in ReadWrite mode for the container, and set the Container Log Path.

  7. Set the application in the container to export logs to the container log path under the volume mount directory.

    After the log collection is completed, it will be printed to the standard output of the container, and you can query the container logs using the toolbox provided by KubeSphere. For more information, see Use the Container Log Query Tool.

Receive the latest news, articles and updates from KubeSphere


Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.

What’s on this Page