tags:

views:

31

answers:

2

hi,

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

+1  A: 

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.

Ignacio Vazquez-Abrams
A: 

I found out about Django Debug Toolbar this week. You should test it.

Before using this I had to check the log files in Apache or the development server's console.

Seitaridis
Do not use Django Debug Toolbar in production environment.
Török Gábor
@Török Gábor: Can you argument your statement?
Seitaridis
@Seitaridis: I think it is a very poor scenario if production is the place where you need to debug. That's rather development and staging. Furthermore, DjDT throws an extra overhead to each requests.
Török Gábor
@Török Gábor: I agree with you that it introduces extra overhead and it should be used only in development, but that was the point since he/she was using the Django's development server. He/She wanted an accessible way to see the console messages. DjDT provides a way of seeing the logs. I didn't say that he/she should use it in production environment.
Seitaridis
@Seitaradis: he writes "when the app is executed via fastgci on a remote server i can't see those messages". He looks for a solution to log messages on an environment different from the development stage.
Török Gábor