TeskaLabs / asab

Asynchronous Server App Boilerplate (ASAB) is a micro-service framework for Python 3 and asyncio.
https://docs.teskalabs.com/asab/
BSD 3-Clause "New" or "Revised" License
29 stars 7 forks source link

I want to be able to extend the AccessLogger in a WebContainer #59

Closed mpavelka closed 2 years ago

mpavelka commented 5 years ago

In the following code of a WebContainer, an AccessLogger is provided to aiohttp.web.AppRunner:

self.WebAppRunner = aiohttp.web.AppRunner(
    self.WebApp,
    handle_signals=False,
    access_log=logging.getLogger(__name__[:__name__.rfind('.')] + '.al'),
    access_log_class=AccessLogger,
)

https://github.com/TeskaLabs/asab/blob/0478fcd23f93fc7da42be6820e4a2a132e997b07/asab/web/container.py#L89

As a developer I want to be able to extend the AccessLogger so that I can enrich structured data in the access log (for example with an identityId).

ateska commented 5 years ago

The ability to specify your own AccessLogger class is enough? @mpavelka

ateska commented 5 years ago

It's more about capabilities of aiohttp ... as far as I can tell.