zoukankan      html  css  js  c++  java
  • horizon 修改local的logging 配置

    再部署完horizon的开发环境后,首先要做的就是修改下logging的输出.

    我用的开发软件是pycharm, 所以,为了方便在 console里看到输出.需要在

    /home/geiao/repo/horizon/openstack_dashboard/local/local_settings.py

    文件中修改logging的配置:

    定义logging的输出格式.修改logging的级别

    下面给出默认的 和修改后的:

    默认:

    LOGGING = {
        'version': 1,
        # When set to True this will disable all logging except
        # for loggers specified in this configuration dictionary. Note that
        # if nothing is specified here and disable_existing_loggers is True,
        # django.db.backends will still log unless it is disabled explicitly.
        'disable_existing_loggers': False,
        'handlers': {
            'null': {
                'level': 'DEBUG',
                'class': 'django.utils.log.NullHandler',
            },
            'console': {
                # Set the level to "DEBUG" for verbose output logging.
                'level': 'INFO',
                'class': 'logging.StreamHandler',
            },
        },
        'loggers': {
            # Logging from django.db.backends is VERY verbose, send to null
            # by default.
            'django.db.backends': {
                'handlers': ['null'],
                'propagate': False,
            },
            'requests': {
                'handlers': ['null'],
                'propagate': False,
            },
            'horizon': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'openstack_dashboard': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'novaclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'cinderclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'keystoneclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'glanceclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'neutronclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'heatclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'ceilometerclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'troveclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'swiftclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'openstack_auth': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'nose.plugins.manager': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'django': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'iso8601': {
                'handlers': ['null'],
                'propagate': False,
            },
        }
    }

    修改之后的,标记:

    LOGGING = {
        'version': 1,
        # When set to True this will disable all logging except
        # for loggers specified in this configuration dictionary. Note that
        # if nothing is specified here and disable_existing_loggers is True,
        # django.db.backends will still log unless it is disabled explicitly.
        'disable_existing_loggers': False,
        'formatters': {
            'verbose': {
                'format': '%(asctime)s %(process)d %(levelname)s %(name)s '
                          '%(message)s'
            },
        },
        'handlers': {
            'null': {
                'level': 'DEBUG',
                'class': 'django.utils.log.NullHandler',
            },
            'console': {
                # Set the level to "DEBUG" for verbose output logging.
                'level': 'DEBUG',
                'class': 'logging.StreamHandler',
                'formatter': 'verbose',
            },
        },
        'loggers': {
            # Logging from django.db.backends is VERY verbose, send to null
            # by default.
            'django.db.backends': {
                'handlers': ['null'],
                'propagate': False,
            },
            'requests': {
                'handlers': ['null'],
                'propagate': False,
            },
            'horizon': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'openstack_dashboard': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'novaclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'cinderclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'keystoneclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'glanceclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'neutronclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'heatclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'ceilometerclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'troveclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'swiftclient': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'openstack_auth': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'nose.plugins.manager': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'django': {
                'handlers': ['console'],
                'level': 'DEBUG',
                'propagate': False,
            },
            'iso8601': {
                'handlers': ['null'],
                'propagate': False,
            },
        }
    }
  • 相关阅读:
    一文带你了解接口测试价值与体系
    干货|app自动化测试之设备交互API详解
    干货|app自动化测试之Appium问题分析及定位
    干货| app自动化测试之Andriod微信小程序的自动化测试
    如果你也有这些职场困惑,周六一直线上答疑
    文末福利 | 团队管理第一步之高效招聘
    精准化测试原理简介与实践探索
    文末有福利 | 面试时如何命中面试官的考题?
    Visual studio prebuild/postbuild 设置条件不生效
    使用腾讯地图api获取定位信息经纬度(需要浏览器支持,且需要https)
  • 原文地址:https://www.cnblogs.com/Jghost/p/3682409.html
Copyright © 2011-2022 走看看