views:

340

answers:

1

I have configured my Django app to run under Apache+FastCGI on Linux (Ubuntu, if it matters). My question is: how to redirect stdout to a file when running Django as fastcgi.

EDIT To clarify: I am familiar with django-logging module and yes I am using it already. This is not what my question is about.

Say when I run Django from the console as

python manage.py runserver

I get all the requests, errors, etc shown in the console, which is stdout. However, when I run it as fastcgi under apache, where does stdout go?

+4  A: 

Print statements should show up in your apache log. From the docs:

"Data written to stdout or stderr before entering the FastCGI accept loop or via a mechanism that is not FastCGI protocol aware will also be directed to the main server log."

You may need to set Apache's LogLevel to info to view the same detail of information you get with runserver.

Jeff Bauer