Files
zulip/bin/log-management-command
Tim Abbott 6c7489ed88 logging: Log management commands that are run.
This could potentially help with debugging exactly what happened with
some issue down the line.

(imported from commit cc7321d742875b644d4727a084b462dcd01dcf10)
2013-11-20 14:31:08 -05:00

17 lines
535 B
Python
Executable File

#!/usr/bin/env python
import sys
import logging
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zproject.settings")
from django.conf import settings
logger = logging.getLogger("zulip.management")
file_handler = logging.FileHandler(settings.MANAGEMENT_LOG_PATH)
formatter = logging.Formatter("%(asctime)s: %(message)s")
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
logger.setLevel(logging.INFO)
logger.info("Ran '%s'" % (sys.argv[1],))