WebFaction
Community site: login faq

How do I get my Django application to print to a log?

The httpd.conf file has the line:

CustomLog /home/my_name/logs/user/access_django.log combined

My program contains the line:

print "testing"

I also tried pprint("testing")

I looked in the file access_django.log in the same directory as specified in httpd.conf. It's empty. The program has executed successfully and definitely reached the print statements.

asked 20 Jul '12, 05:34

ttt
134
accept rate: 0%

edited 20 Jul '12, 05:34


We are using mod_wsgi by default in our stack and you can read their official documentation on how to write or read from standard output here.

The creator of mod_wsgi has also posted a blog entry about it. You can take a look at it here.

permanent link

answered 20 Jul '12, 10:19

iliasr ♦♦
2.2k14
accept rate: 34%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×910
×28

question asked: 20 Jul '12, 05:34

question was seen: 6,359 times

last updated: 20 Jul '12, 10:19

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM