Updated on 2025-07-26 GMT+08:00

Log Management

CCI allows you to mount a log storage volume for log collection. To write logs to the log storage volume, you only need to add the log storage volume when you create a workload.

CCI is interconnected with Application Operations Management (AOM). AOM collects the .log files in container log storage and dumps them in AOM.

By default, the audit.log, oss.icAgent.trace, oss.script.trace, and audit_*.log files are not collected. Do not use these names for the logs.

You can click View Logs in the Pod List area on the details page of a workload to view logs.
Figure 1 Viewing logs

Log Collection Reliability

The log system's main purpose is to record all stages of data for service components, including startup, initialization, exit, runtime details, and exceptions. It is primarily employed in O&M scenarios for tasks like checking component status and analyzing fault causes.

Standard streams (stdout and stderr) and local log files use non-persistent storage. However, data integrity may be compromised due to the following risks:

  • Log rotation and compression potentially deleting old files
  • Temporary storage volumes being cleared when Kubernetes pods end
  • Automatic OS cleanup triggered by limited node storage space

While the Cloud Native Log Collection add-on employs techniques like multi-level buffering, priority queues, and resumable uploads to enhance log collection reliability, logs could still be lost in the following situations:

  • The service log throughput surpasses the collector's processing capacity.
  • The service pod is abruptly terminated and reclaimed by CCE.
  • The log collector pod experiences exceptions.

The following lists some recommended best practices for cloud native log management. You can review and implement them thoughtfully.

  • Use dedicated, high-reliable streams to record critical service data (for example, financial transactions) and store the data in persistent storage.
  • Avoid storing sensitive information like customer details, payment credentials, and session tokens in logs.

Adding a Log Storage Volume

You can add a log storage volume for a container when you create a workload.

  • Container Log Path: path to which the log storage volume is attached. Ensure that it matches the log output path of the application so that logs can be written to the log storage volume.
    1. Ensure that the log storage volume path does not exist in the current container. Otherwise, the content under the existing path will be cleared.
    2. Only .log, .trace, and .out files in the log path are collected.
    3. A maximum of 20 log files can be collected. Therefore, your logs can be exported to a maximum of 20 files in the log path.
  • Log Storage Space: space of storing logs.
    1. AOM provides each account free 500-MB log storage space each month. You will be billed for any extra space you use on a pay-per-use basis. For details, see Product Pricing Details.
    2. Log Storage Space can only be set to 1 or 2. When the backend calls the API to create a workload, ensure the obtained value is 1 GiB or 2 GiB.
    3. The space is free of charge. The collection will fail in the case of timeout. Therefore, for a log file larger than 2 GB, dump it in advance.
Figure 2 Using the log storage volume

Viewing Logs

After you create the workload, you can view container logs.

Click the workload, and click View Logs in the same row as the pod.

Figure 3 Viewing logs

You can view the logs of a container on the AOM console. For details about how to view logs in AOM, see Viewing Log Files.