-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't understand why access log is not working out of the box #2469
Comments
Add
into |
Hi @asvetlov. Thanks for the fast response. Unfortunately it doesn't work. Here is the code: import asyncio
import logging
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)
logging.basicConfig()
# start the application
web.run_app(app, host='0.0.0.0', port=8701)
if __name__ == '__main__':
main() |
@asvetlov found the solution by: Adding Thanks for your help. Worked like a shiny light :D |
Would you make a Pull Request for http://aiohttp.readthedocs.io/en/stable/logging.html to help other newbies? |
No answer -- closing |
is there a good solution to aiohttp? https://aiohttp.readthedocs.io/en/stable/logging.html
the doc seems fuzzy.. |
If anyone ends up here, and needs a quick solution, here's an option that will work. The problem is that the
Final thoughts: don't do
These can be accessed by calling |
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:
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
The text was updated successfully, but these errors were encountered: