查看容器日志

更新时间:
复制为 MD 格式

容器日志指容器的标准输出,在容器启动失败或者其他场景,您可以通过控制台查看容器日志,用于定位容器相关问题。本文介绍如何查看容器日志。

操作步骤

  1. 访问轻量应用服务器控制台-容器服务

  2. 容器服务页面,单击目标容器服务实例ID。

    如果容器服务较多,可在搜索文本框中,输入容器服务实例ID筛选容器服务。

  3. 概览页签下的容器组信息区域,单击目标容器组操作列中的查看日志

  4. 在弹出的查看日志对话框,在目标容器下单击查看

  5. 在弹出的容器日志对话框中,查看容器日志。

    /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
    /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
    /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
    10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
    10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
    /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
    /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
    /docker-entrypoint.sh: Configuration complete; ready for start up
    2023/12/18 06:43:02 [notice] 113#113: using the "epoll" event method
    2023/12/18 06:43:02 [notice] 113#113: nginx/1.21.5
    2023/12/18 06:43:02 [notice] 113#113: built by gcc 10.2.1 20210110 (Debian 10.2.1-6)
    2023/12/18 06:43:02 [notice] 113#113: OS: Linux 4.19.91-20220519040629.182dd72.a17.x86_64
    2023/12/18 06:43:02 [notice] 113#113: getrlimit(RLIMIT_NOFILE): 1048576:1048576
    2023/12/18 06:43:02 [notice] 113#113: start worker processes
    2023/12/18 06:43:02 [notice] 113#113: start worker process 138
    2023/12/18 06:43:02 [notice] 113#113: start worker process 139
    10.17.12.19 - - [18/Dec/2023:06:43:21 +0000] "HEAD / HTTP/1.0" 200 0 "-" "-" "-"
    10.17.12.19 - - [18/Dec/2023:06:43:28 +0000] "HEAD / HTTP/1.0" 200 0 "-" "-" "-"
    10.17.12.19 - - [18/Dec/2023:06:43:36 +0000] "HEAD / HTTP/1.0" 200 0 "-" "-" "-"
    10.17.12.19 - - [18/Dec/2023:06:43:43 +0000] "HEAD / HTTP/1.0" 200 0 "-" "-" "-"
    10.17.12.19 - - [18/Dec/2023:06:43:51 +0000] "HEAD / HTTP/1.0" 200 0 "-" "-" "-"