zoukankan      html  css  js  c++  java
  • Docker,就放弃了把日志写入文件

    日志配置

    既然用 Docker,就放弃了把日志写入文件,直接写到标准输出。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    # settings.py 
    # ...
    LOGGING = {
        'version'1,
        'disable_existing_loggers'False,
        'formatters': {
            'verbose': {
                'format''[application] %(levelname)s %(asctime)s %(module)s %(message)s'
            }
        },
        'handlers': {
            'console': {
                'level''DEBUG',
                'class''logging.StreamHandler',
                'stream': sys.stdout,
                'formatter''verbose'
            },
        },
        'loggers': {
            'app': {
                'handlers': ['console'],
                'level''DEBUG',
                'propagate'True,
            },
        },
    }

    新版本的 uwsgi 已经可以把 webapp 的日志收集起来输出到标准输出里面了。如果需要收集、管理日志的话,就是用 Docker 日志收集工具,直接收集 Docker 容器的日志即可

  • 相关阅读:
    【版本特性】sql server2012版本特性
    sql server2012中的format
    IOS插件管理器: alcatraz
    IOS中类似的。9.png图片
    IOS学习之路- 运行过程
    IOS学习之路--BLOCK
    IOS学习之路--OC的基础知识
    IOS学习之路-- 指针&宏函数
    域名解析问题。
    android点击状态分析
  • 原文地址:https://www.cnblogs.com/cheyunhua/p/11194384.html
Copyright © 2011-2022 走看看