Commit b1779aaf authored by Andreas Jung's avatar Andreas Jung

- new env. variable LOG_ZPUBLISHER_TRACEBACK

        (see doc/ENVIRONMENT.txt)
parent 8642647c
......@@ -73,6 +73,9 @@ Zope Changes
- New implementation of ZODB object cache.
- new env. variable LOG_ZPUBLISHER_TRACEBACK
(see doc/ENVIRONMENT.txt)
Bugs:
- Made repr of an HTTPRequest.record eval'able as a dict (Collector
......
......@@ -140,6 +140,12 @@ Debugging and Logging
Run Zope in debug mode if set. Same as -D options (z2.py)
LOG_ZPUBLISHER_TRACEBACK
If set, Zope will log all ZPublisher traceback through
the stupid logger. (Default: unset)
Misc.
Z_REALM "your realm"
......
##############################################################################
#############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
......@@ -12,10 +12,11 @@
##############################################################################
'''CGI Response Output formatter
$Id: HTTPResponse.py,v 1.57 2002/04/05 16:00:17 htrd Exp $'''
__version__='$Revision: 1.57 $'[11:-2]
$Id: HTTPResponse.py,v 1.58 2002/04/12 17:22:44 andreasjung Exp $'''
__version__='$Revision: 1.58 $'[11:-2]
import types, os, sys, re
import zLOG
from string import translate, maketrans
from types import StringType, InstanceType, LongType, UnicodeType
from BaseResponse import BaseResponse
......@@ -175,7 +176,8 @@ class HTTPResponse(BaseResponse):
if type(status) is types.StringType:
status=status.lower()
if status_codes.has_key(status): status=status_codes[status]
else: status=500
else:
status=500
self.status=status
if reason is None:
if status_reasons.has_key(status): reason=status_reasons[status]
......@@ -607,6 +609,10 @@ class HTTPResponse(BaseResponse):
(str(t), b + self._traceback(t,'(see above)', tb, 0)),
is_error=1)
del tb
if os.environ.has_key('LOG_ZPUBLISHER_TRACEBACK'):
zLOG.LOG('zpublisher',zLOG.WARNING,'Traceback:',body)
return body
_wrote=None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment