How to print Django's runserver output to a file?
when i develop my django app locally, i use python manage.py runserver
and all errors messages (like Error 500 ...) are printed in the terminal.
It is useful because it enables to put s开发者_C百科ome print
in the code and check the values of some variables.
But when the app is executed via fastgci on a remote server i can't see those messages. Is there a way to output those errors in a file? Thanks
Barring bugs in the web server, error messages generated by FastCGI apps should be logged in the web server's error log. Use your web server configuration options to control where the log is created.
And don't use print
, use logging
instead.
精彩评论