Opened 7 years ago

Closed 7 years ago

#6687 closed (fixed)

Logging stdin/stderr with a daemonized fastcgi process

Reported by: tamas Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: daemonize, fastcgi, logging
Cc: django@… Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Django has a nice daemonizing function django.utils.daemonize.become_daemon, which takes out_log and err_log keyword arguments. django.core.servers.fastcgi makes use of become_daemon, but only the our_home_dir is specified and the out_log and err_log arguments are not being utilized.

This patch proposes adding outlog and errlog as additional fastcgi options so that you can specify files to redirect stderr and stdout to for daemonized fastcgi processes via manage.py runfcgi.

Its a simple change to fastcgi.py. In addition, a line needed to be added to daemonize.py, so that the file descriptors are line buffered for posix systems.

Attachments (1)

fastcgi-log-routing.diff (1.9 KB) - added by tamas 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by tamas

comment:1 Changed 7 years ago by Simon G <dev at simon dot net dot nz>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by jedie

  • Cc django@… added

comment:3 Changed 7 years ago by mtredinnick

  • Needs documentation set
  • Triage Stage changed from Ready for checkin to Accepted

It seems that the fastcgi.txt file would need to be updated as a result of this change. Other than that, the patch is fine.

comment:4 Changed 7 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

(In [7297]) Fixed #6687: added outlog/errlog options to runfcgi. Thanks, tamas.

Note: See TracTickets for help on using tickets.
Back to Top