Skip to content

Commit e97886a

Browse files
committed
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.
1 parent 88a9939 commit e97886a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGES.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ Fixed:
191191
can affect calls using requests package or curl. A roundup admin
192192
would have to write detectors/extensions that use these mechanisms.
193193
Not exploitable in default config. (John Rouillard)
194-
194+
- Add config option to keep/delete previous logging config. Needed to
195+
make gunicorn --access-logfile work as it uses python logfile module
196+
too.
195197

196198
2018-07-13 1.6.0
197199

roundup/configuration.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,9 @@ def str2value(self, value):
10311031
"Minimal severity level of messages written to log file.\n"
10321032
"If above 'config' option is set, this option has no effect.\n"
10331033
"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"),
10341037
)),
10351038
("mail", (
10361039
(Option, "domain", NODEFAULT,
@@ -1738,7 +1741,8 @@ def reset(self):
17381741
def init_logging(self):
17391742
_file = self["LOGGING_CONFIG"]
17401743
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"])
17421746
return
17431747

17441748
_file = self["LOGGING_FILENAME"]

0 commit comments

Comments
 (0)