openstack(essex)配置文件--local_settings.py

1.local_settings.py

 

/etc/openstack-dashboard/local_settings.py
/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py

这两个文件是一个,用ll查看第二个,指向第一个

 

 

 一:调试信息

from django.utils.translation import ugettext_lazy as _
Verbose= True                                   
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROD = False
USE_SSL = False

 

其中Verbose 和DEBUG控制开发中页面错误会否抛出

 

 二。

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': True,#False,
        'handlers': {
            'null': {
                'level': 'DEBUG',
                'class': 'django.utils.log.NullHandler',
                },
            'console': {
                # Set the level to "DEBUG" for verbose output logging.
                'level': 'INFO',#'DEBUG',#'INFO',设置点1
                'class': 'logging.StreamHandler',
                },
            },

'loggers': {
            # Logging from django.db.backends is VERY verbose, send to null
            # by default.
            'django.db.backends': {
                'handlers': ['null'],
                'propagate': False,
                },
            'horizon': {
                'handlers': ['console'],
                'propagate': False,   设置点2
            },
            'novaclient': {
                'handlers': ['console'],
                'propagate': False,
            },
            'keystoneclient': {
                'handlers': ['console'],
                'propagate': False,
            },
            'nose.plugins.manager': {
                'handlers': ['console'],
                'propagate': False,
            }
        }
}

 

 

 

 

1.设置点1默认是INFO,如果设置成DEBUG,REQ  , RESP,  REQ BODY,RESP BODY日志都将打印出来,例如:

 

 Creating a new keystoneclient connection to http://192.168.240.102:35357/v2.0.
DEBUG:horizon.api.keystone:Creating a new keystoneclient connection to http://192.168.240.102:35357/v2.0.
[Fri Jan 11 10:04:27 2013] [error] REQ: curl -i http://192.168.240.102:35357/v2.0/tokens -X POST -H "User-Agent: python-keystoneclient" -H "Content-Type: application/json" -H "X-Auth-Token: 4737b700e17c43e197976d3dfae8d721"
[Fri Jan 11 10:04:27 2013] [error]
[Fri Jan 11 10:04:27 2013] [error] REQ BODY: {"auth": {"token": {"id": "4737b700e17c43e197976d3dfae8d721"}, "tenantId": "f5d66aa3625e44149f671ab7d015bd5f"}}
[Fri Jan 11 10:04:27 2013] [error]
[Fri Jan 11 10:04:27 2013] [error] RESP: {'date': 'Fri, 11 Jan 2013 02:04:27 GMT', 'transfer-encoding': 'chunked', 'status': '200', 'vary': 'X-Auth-Token', 'content-type': 'application/json'}
[Fri Jan 11 10:04:27 2013] [error] RESP BODY: {"access": {"token": {"expires": "2013-01-11T07:52:12Z", "id": "54084645af4d4ca0ba515c363a512eeb", "tenant": {"description": null, "enabled": true, "id": "f5d66aa3625e44149f671ab7d015bd5f", "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.240.102:8774/v2/f5d66aa3625e44149f671ab7d015bd5f", "region": "RegionOne", "internalURL": "http://192.168.240.102:8774/v2/f5d66aa3625e44149f671ab7d015bd5f", "publicURL": "http://192.168.240.102:8774/v2/f5d66aa3625e44149f671ab7d015bd5f"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.168.240.102:9292/v1", "region": "RegionOne", "internalURL": "http://192.168.240.102:9292/v1", "publicURL": "http://192.168.240.102:9292/v1"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://192.168.240.102:8776/v1/f5d66aa3625e44149f671ab7d015bd5f", "region": "RegionOne", "internalURL": "http://192.168.240.102:8776/v1/f5d66aa3625e44149f671ab7d015bd5f", "publicURL": "http://192.168.240.102:8776/v1/f5d66aa3625e4。。。。

 

 

2.设置点2,默认False,设置成True

DEBUG:horizon.api.keystone:Creating a new keystoneclient connection to http://192.168.240.102:35357/v2.0.
 DEBUG:horizon.api.nova:novaclient connection created using token "4737b700e17c43e197976d3dfae8d721" and url "http://192.168.240.102:8774/v2/f5d66aa3625e44149f671ab7d015bd5f"

 

这样的日志都会出来

 

这些日志的打印开关在NovaClient/client.py中

 def http_log

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值