Mercurial > p > roundup > code
comparison roundup/configuration.py @ 5939:94c415c7cd36
Make gunicorn --access-logfile work with custom logging config
Added config option to keep/delete previous logging config. Needed to
make gunicorn --access-logfile work as it uses python logfile module
too.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 21 Oct 2019 20:53:08 -0400 |
| parents | 1b57d8f3eb97 |
| children | 1cfd52dee91b |
comparison
equal
deleted
inserted
replaced
| 5938:16eec1c41e0e | 5939:94c415c7cd36 |
|---|---|
| 1029 "If above 'config' option is set, this option has no effect."), | 1029 "If above 'config' option is set, this option has no effect."), |
| 1030 (Option, "level", "ERROR", | 1030 (Option, "level", "ERROR", |
| 1031 "Minimal severity level of messages written to log file.\n" | 1031 "Minimal severity level of messages written to log file.\n" |
| 1032 "If above 'config' option is set, this option has no effect.\n" | 1032 "If above 'config' option is set, this option has no effect.\n" |
| 1033 "Allowed values: DEBUG, INFO, WARNING, ERROR"), | 1033 "Allowed values: DEBUG, INFO, WARNING, ERROR"), |
| 1034 (BooleanOption, "disable_loggers", "no", | |
| 1035 "If set to yes, only the loggers configured in this section will\n" | |
| 1036 "be used. Yes will disable gunicorn's --access-log.\n"), | |
| 1034 )), | 1037 )), |
| 1035 ("mail", ( | 1038 ("mail", ( |
| 1036 (Option, "domain", NODEFAULT, | 1039 (Option, "domain", NODEFAULT, |
| 1037 "The email domain that admin_email, issue_tracker and\n" | 1040 "The email domain that admin_email, issue_tracker and\n" |
| 1038 "dispatcher_email belong to.\n" | 1041 "dispatcher_email belong to.\n" |
| 1736 self.init_logging() | 1739 self.init_logging() |
| 1737 | 1740 |
| 1738 def init_logging(self): | 1741 def init_logging(self): |
| 1739 _file = self["LOGGING_CONFIG"] | 1742 _file = self["LOGGING_CONFIG"] |
| 1740 if _file and os.path.isfile(_file): | 1743 if _file and os.path.isfile(_file): |
| 1741 logging.config.fileConfig(_file) | 1744 logging.config.fileConfig(_file, |
| 1745 disable_existing_loggers=self["LOGGING_DISABLE_LOGGERS"]) | |
| 1742 return | 1746 return |
| 1743 | 1747 |
| 1744 _file = self["LOGGING_FILENAME"] | 1748 _file = self["LOGGING_FILENAME"] |
| 1745 # set file & level on the roundup logger | 1749 # set file & level on the roundup logger |
| 1746 logger = logging.getLogger('roundup') | 1750 logger = logging.getLogger('roundup') |
