您的位置:首页 > 运维架构

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

2013-01-07 16:07 459 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: