Skip to content

Can't understand why access log is not working out of the box #2469

Closed
@ricmalta

Description

Long story short

How do I enable the access log?
I just configured the web interface with the minimum configurations possible. Reading the docs, the logging should work out of the box right?

Here is my main app code:

import asyncio
from aiohttp import web

async def get_index(req):
    """ get the analytics results """
    return web.json_response({ 'ok': True })

def main():
    """ the main application start """

    # the the main event loop
    loop = asyncio.get_event_loop()

    # create the main web app
    app = web.Application(loop=loop)
    
    # add analytics routes
    app.router.add_get('/v1/analytics', get_index)

    # start the application
    web.run_app(app, host='0.0.0.0', port=8701)

if __name__ == '__main__':
    main()

I debugged aiohttp the code, but wont found anything blocking the logs.
I'm new to Python on the web and aiohttp.

Expected behaviour

I want the default access log to out.

Actual behaviour

nothing shown in the terminal

Steps to reproduce

Just run

Your environment

macOS 10.12.6
Python 3.6.1
aiohttp==2.3.2

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions