Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Django app running on fastcgi and when there's an exception it seems like it getting cut off in the logs error.log:

2012/06/10 19:25:55 [error] 1416#0: *19219 FastCGI sent in stderr: "Traceback (most recent call last):
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/flup/server/", line 574, in run
    protocolStatus, appStatus = self.server.handler(self)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/flup/server/", line 1159, in handler
    result = self.application(environ, start_response)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/handlers/", line 273, in __call__
    response = self.get_response(request)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/handlers/", line 169, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/handlers/", line 209, in handle_uncaught_exception
  File "/usr/local/lib/python2.7/logging/", line 1154, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/local/lib/python2.7/logging/", line 1246, in _log
  File "/usr/local/lib/python2.7/logging/", line 1256, in handle
  File "/usr/local/lib/python2.7/logging/", line 1293, in callHandlers
  File "/usr/local/lib/python2.7/logging/", line 740, in handle
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/utils/", line 101, in emit
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/mail/", line 96, in mail_admins
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/mail/", line 251, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/home/deploy/.virtualenv/mediapop/li

Can I remedy that so I have the full stack trace?

share|improve this question
up vote 2 down vote accepted

I recommend keeping your web server error log and your application error log separate. This neatly separates two layers of your stack, as the web server logs will contain the http-level errors, while the app log will contain exceptions thrown by your code and other custom logging you generate.

This post has more on Django error logging, including recommendations for other options to log your Django stack traces.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .