#18243: Management shell should make it easy to force LOGGING_CONFIG=None
-------------------------------------+-------------------------------------
Reporter: ncoghlan@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Management | Version: 1.3
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):
* needs_better_patch: => 0
* component: Uncategorized => Core (Management commands)
* needs_tests: => 0
* needs_docs: => 0
Comment:
I'm not convinced that adding a new command line parameter is the right
fix.
What about creating a custom logging Handler in your application which
would output to file if permissions are sufficient, else write to
sys.stderr (or stdout).
{{{
import logging
class FailsafeFileHandler(logging.FileHandler):
def _open(self):
try:
return super(CustomFileHandler, self)._open()
except IOError:
return None # Should default to StreamHandler sys.stderr
}}}
Completely untested, but you get the idea. Then use this handler in your
logging config.
--
Ticket URL: <https://code.djangoproject.com/ticket/18243#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.