Updated on 2023-08-23 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.

If the service performance does not meet the expectation, it may be caused by excessive logging. For details, see Why Service Performance Does Not Meet the Expectation?

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

You can click View Logs in the Pod List area on the details page of a workload to view logs.
Figure 1 Viewing 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 500 MB log storage space for free 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.