Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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/fcgi_base.py", line 574, in run
    protocolStatus, appStatus = self.server.handler(self)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/flup/server/fcgi_base.py", line 1159, in handler
    result = self.application(environ, start_response)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 273, in __call__
    response = self.get_response(request)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/handlers/base.py", 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/base.py", line 209, in handle_uncaught_exception
    'request':request
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1154, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1246, in _log
    self.handle(record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1256, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1293, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 740, in handle
    self.emit(record)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/utils/log.py", line 101, in emit
    html_message=html_message)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/mail/__init__.py", line 96, in mail_admins
    mail.send(fail_silently=fail_silently)
  File "/home/deploy/.virtualenv/mediapop/lib/python2.7/site-packages/django/core/mail/message.py", 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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.