edit-icon download-icon

Log

Last Updated: Feb 12, 2018

Template version

Both Compose V1/V2 and Compose V3 orchestration templates support the log labels and use the same syntax.

Function overview

Container Service, integrated with Alibaba Cloud Log Service, collects container logs and sends the logs to Alibaba Cloud Log Service. For more information, see Enable Log Service.

Orchestration examples:

Compose V1/V2 example:

  1. mysql:
  2. image: mysql
  3. ports:
  4. - 80
  5. labels:
  6. aliyun.scale: "1"
  7. environment:
  8. - MYSQL_ROOT_PASSWORD=password
  9. wordpress:
  10. image: registry.aliyuncs.com/jiangjizhong/wordpress
  11. ports:
  12. - 80
  13. labels:
  14. aliyun.routing.port_80: wordpress-with-log
  15. aliyun.log_store_dbstdout: stdout #Note here
  16. links:
  17. - mysql

Compose V3 example:

  1. version: '3'
  2. services:
  3. web:
  4. image: wordpress:4
  5. ports:
  6. - 80
  7. depends_on:
  8. - mysql
  9. deploy:
  10. replicas: 3
  11. restart_policy:
  12. condition: on-failure
  13. labels:
  14. aliyun.routing.port_80: wordpress
  15. aliyun.log_store_dbstdout: stdout #Note here
  16. mysql:
  17. image: mysql:5.7
  18. environment:
  19. - MYSQL_ROOT_PASSWORD=password
  20. deploy:
  21. restart_policy:
  22. condition: on-failure
Thank you! We've received your feedback.