classification
Title: Add support for args and kwargs in logging.conf
Type: enhancement Stage: resolved
Components: Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.5, Python 3.4, Python 2.7
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: vinay.sajip, xavier.hardy, xtreak
Priority: normal Keywords: patch

Created on 2018-08-08 08:02 by xavier.hardy, last changed 2018-08-14 18:32 by vinay.sajip. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8758 closed xavier.hardy, 2018-08-13 19:59
Messages (3)
msg323269 - (view) Author: Xavier Hardy (xavier.hardy) * Date: 2018-08-08 08:02
The behavior of formatters and handlers in logging.conf files is inconsistent.

With handlers, it is possible to add custom (keyword and non-keyword) arguments, but it is not possible for formatters (only class, format, datefmt, style).

https://github.com/python/cpython/blob/master/Lib/logging/config.py#L112
https://github.com/python/cpython/blob/master/Lib/logging/config.py#L141

I'll try to submit a pull request as soon as possible.
msg323502 - (view) Author: Karthikeyan Singaravelan (xtreak) * Date: 2018-08-14 05:24
Adding Vinay for his thoughts on this. Also Python 3.4 and 3.5 are in security fixes only mode and can be removed.

Thanks
msg323532 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2018-08-14 18:32
There aren't any changes planned to the fileConfig code, other than bug fixes. If you need improved functionality, you can use dictConfig, which already supports improved configuration features when compared to fileConfig.

The fileConfig API was present when the logging package was first added to Python, and dictConfig is a later enhancement (PEP 391).
History
Date User Action Args
2018-08-14 18:32:33vinay.sajipsetstatus: open -> closed
resolution: rejected
messages: + msg323532

stage: patch review -> resolved
2018-08-14 05:24:18xtreaksetnosy: + vinay.sajip, xtreak
messages: + msg323502
2018-08-13 19:59:35xavier.hardysetkeywords: + patch
stage: patch review
pull_requests: + pull_request8234
2018-08-08 08:02:57xavier.hardycreate