• [Docker]如何使用docker logs 查看容器内日志


    主要是将日志文件输出到/dev/stdout

    RUN curl -L http://mirrors.aliyun.com/repo/epel-7.repo -o /etc/yum.repos.d/epel-7.repo 
        && yum install -y nginx 
        && sed -i '/::/d' /etc/nginx/nginx.conf 
        && rm -rf /usr/share/nginx/html/index.html 
        && echo 'Hello World' > /usr/share/nginx/html/index.html 
        && ln -sf /dev/stdout /var/log/nginx/access.log && 
        && ln -sf /dev/stderr /var/log/nginx/error.log
    

    # docker logs 8ffbc07de735
    10.1.31.201 - - [30/Jun/2020:16:02:45 +0000] "GET / HTTP/1.1" 200 12 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:45 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:46 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:47 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:47 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:47 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:47 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:47 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:47 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    10.1.31.201 - - [30/Jun/2020:16:02:47 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45" "-"
    

    END

  • 相关阅读:
    js笔记一:在HTML中使用javascript
    opencv排错总结
    《学习openCV》例程解析 ex_8_2 (轮廓)
    《学习openCV》例程解析 ex_9_3(codeBook模型实现背景减除)
    《学习openCV》例程解析 ex_9_1 (像素片段)
    《学习openCV》例程解析 ex_9_2(背景减除)
    《学习openCV》例程解析 ex_8_3 (轮廓)
    JavaScript鼠标事件
    sumlime text2 快捷键
    HTML字符实体(转)
  • 原文地址:https://www.cnblogs.com/leoshi/p/13216923.html
Copyright © 2020-2023  润新知