12

I have a Django project where I have been logging to a file using the standard library logging module. For a variety of reasons I would like to change it so that it writes to the Apache log files. I've seen quite a bit of discussion of how to do this with mod_python, but not mod_wsgi. How do I do this for a project running under mod_wsgi?

1

1 Answer 1

13

Mostly, we use logging and write to sys.stderr. That seems to write to the Apache error_log.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. That seems to be the way to do it. The comments on this post djangosnippets.org/snippets/1731 say the same thing.
As simple as that. Great!!
@DavidMontgomery: the comment you link to is helpful. A currently more legible version of the same comment can be found at artyname.tumblr.com/post/390511693/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.