首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在客户端获取paster/waitress应用程序的服务器堆栈跟踪

如何在客户端获取paster/waitress应用程序的服务器堆栈跟踪
EN

Stack Overflow用户
提问于 2014-05-11 22:29:39
回答 1查看 883关注 0票数 2

我正在运行一个python金字塔应用程序,并对其进行restful调用。这是一个wsgi应用程序,使用waitress作为http服务器。目前,当我发出一个失败的http请求时,我得到如下消息:

代码语言:javascript
复制
Internal Server Error
The server encountered an unexpected internal server error

如何配置waitress或paster本身以获取显示堆栈跟踪的错误,如下所示:

代码语言:javascript
复制
Traceback (most recent call last):
  File "/.../pyramid/eggs/waitress-0.8.8-py2.7.egg/waitress/channel.py", line 337, in service
    task.service()
  File "/.../pyramid/eggs/waitress-0.8.8-py2.7.egg/waitress/task.py", line 173, in service
    self.execute()
  ...
  File "/.../pyramid/eggs/pyramid-1.4.5-py2.7.egg/pyramid/config/views.py", line 469, in _class_requestonly_view
    response = getattr(inst, attr)()
  File "/.../pyramid/dustin/views.py", line 139, in delete
    raise Exception('DELETE op failed; oid %s not found' % deleteItem)
Exception: DELETE op failed; oid 00x not found

我的paster配置是:

代码语言:javascript
复制
[app:main]
use = egg:myegg

pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.debug_templates = true
pyramid.default_locale_name = es

couchdb.uri = http://couchdb-host:5984/
couchdb.db = myegg

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543

# Begin logging configuration

[loggers]
keys = root

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[handler_console]
class = StreamHandler
args = [sys.stdout]
level = DEBUG
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

# End logging configuration
EN

回答 1

Stack Overflow用户

发布于 2014-05-12 22:08:48

您是否可以使用Exception View来捕获任何异常,并在响应中返回堆栈跟踪?我使用了类似的方法来捕获所有的金字塔异常,记录它们,然后向用户显示一个“友好的”错误页面渲染器。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23593828

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档