zoukankan      html  css  js  c++  java
  • [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

  • 相关阅读:
    插入排序
    APPlication,Session,Cookie,ViewState和Cache之间的区别
    sqlserver 2005新特性
    选择排序
    Transact_SQL小手册
    装箱和取消装箱
    select语句的执行步骤:
    using 的三种用法
    创建索引及撤销
    (转译)用FFmpeg和SDL写播放器08软件缩放
  • 原文地址:https://www.cnblogs.com/leoshi/p/13216923.html
Copyright © 2011-2022 走看看