Opened 14 years ago

Closed 14 years ago

#14324 closed (invalid)

Django not rotating logs

Reported by: mikewash Owned by: nobody
Component: Core (Other) Version: 1.0
Severity: Keywords: rotating logs
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

System Information:
Python 2.5.2
Apache 2.2
Windows XP

I was trying to rotate logs in django but it kept delivering this error [Windows Error 32] when running it in the development environment (python manage.py runserver). I was curious if there is some way to rotate logs to work in sync with the Django Framework.

Also I placed the code in the settings.py file.

Here is the code

logger = logging.getLogger("")
logger.setLevel(logging.DEBUG)
handler = logging.handlers.RotatingFileHandler(LOG_FILE, maxBytes=20, backupCount=5)
handler.setFormatter(logging.Formatter(LOG_FORMAT))
logger.addHandler(handler)

Change History (2)

comment:1 by mikewash, 14 years ago

comment:2 by Karen Tracey, 14 years ago

Resolution: invalid
Status: newclosed

This Trac is for reporting bugs in Django. Currently Django does not even use Python logging, so it is hard to see how what you are describing could be a bug in Django code. This question would be more likely to get helpful responses on either django-users, #django IRC, or possibly a Python list, since the logging module comes from Python.

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