How to get python tracebacks into production log?

72 views
Skip to first unread message

Ksenia

unread,
Jan 14, 2007, 8:14:45 AM1/14/07
to TurboGears
Hi people,

Two problems:

1) It seems to me that by default quickstarted project in production
does not log python tracebacks into server log. I tried to change
logging configuration but it didn't help, the only way i could get
traceback is by setting server.environment to "development".

2) When TG process started with start-stop-daemon, there is no log...
at all. My script is started as follows:

start-stop-daemon --chuid $USER --start --pidfile $PIDFILE \
--chdir $APP_PATH --background --make-pidfile --startas
$DAEMON -- $CONFIG

(where APP_PATH is TG applicaiton path and DAEMON is the start-app.py
script)

The only way I could get logfile in this case was completely removing
logging configuration from prod.cfg and removing log.cfg.


Does anybody have a working example of production logging config that
logs traceback?! That would be very helpful.


Thanks a lot,

Ksenia

Jason Chu

unread,
Jan 15, 2007, 2:02:28 PM1/15/07
to turbo...@googlegroups.com

I had to fiddle with it for quite a while, but here is something that
outputs tracebacks. Change the [[[fatboy]]] and qualname='fatboy' to
whatever your project name is.

I believe the tracebacks happen in cherrypy.msg. This is only for
errors, it doesn't display anything like an access_log. I think you'll
have to fiddle around with the access_out directive for that.

Jason

[logging]

[[formatters]]
[[[full_content]]]
format='*(asctime)s *(name)s *(levelname)s *(message)s'

[[handlers]]

#[[[access_out]]]
## set the filename as the first argument below
#args="('server.log',)"
#class='FileHandler'
#level='INFO'
#formatter='full_content'

[[[error_out]]]
args="('server.log',)"
class='FileHandler'
level='DEBUG'
formatter='full_content'

[[loggers]]
[[[fatboy]]]
level='DEBUG'
qualname='fatboy'
handlers=['error_out']

[[[access]]]
level='INFO'
qualname='cherrypy.msg'
handlers=['error_out']
#propagate=0

signature.asc
Reply all
Reply to author
Forward
0 new messages