aio-libs / aio-libs/aiohttp

access logging refactoring

Aperta
#3,795 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
16.5k
Fork
2.4k
Merge medio
17h 22m
PR unite (30g)
212

Descrizione

## Long story short

Now `access_log_class`, `access_log` and `access_log_format` are used by public API to control access logger settings.

It is a design mistake, sorry.

The proposal is:
1. deprecate `access_log_class` and `access_log_format` parameters
2. deprecate `logging.Logger` value for `access_log`
3. accept `AbstractAsyncAccessLogger` as `access_log` parameter.
4. process `access_log=None` as default, keep the default behavior as is now
5. move access logger creation logic from `web_protocol.py` to `web_runner.py`
6. explicitly deprecate access logging params in `web_server` as well.

The API uses too much `kwargs` now, backward-compatible changes are possible but need very careful review. All existing public API for access log setup should work in aiohttp 4.0 and can be removed in 5.0

The issue requires a lot of work.
I'm happy to review it but have no capacity to do it myself in a few months.
We are looking for a champion :)

See also #3777 and #3767

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.