Mermoz
Mermoz

Reputation: 15474

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 some printin 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

Upvotes: 1

Views: 1504

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798536

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.

Upvotes: 1

Related Questions