Skip to content
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

Turn off access log with gunicorn #1143

Closed
op13op opened this issue Feb 26, 2018 · 5 comments
Closed

Turn off access log with gunicorn #1143

op13op opened this issue Feb 26, 2018 · 5 comments

Comments

@op13op
Copy link

op13op commented Feb 26, 2018

Is there any way to turn off access log with gunicorn?
I could not find any example to set access_log=False with gunicorn.

@yunstanford
Copy link
Member

By default, accesslog is None if i recall correctly

@op13op
Copy link
Author

op13op commented Feb 27, 2018

By default, access_log is True.
So, the only way i found to turn off access log is passing a log_config which without "sanic.access".

@yunstanford
Copy link
Member

did you try define your own gunicorn_logconfig.ini ?

@ardergit
Copy link

@yunstanford Can you give an example how such a file should look like? I am unable to stop sanic.access log. I am using Gunicorn and Sanic on Heroku. No matter what I configure, I still see the access log if I tail the logs.

@arnulfojr
Copy link
Contributor

I have tried sanic with the default set up using gunicorn with the default configuration and sanic outputs twice the access logs, once in gunicorn and once with sanic.accesslog

https://github.com/channelcat/sanic/blob/818a8c2196fb14aab3ee30cd2fef845d0b7148ef/sanic/worker.py#L50-L70

But then in the Sanic's _helper function we have:

https://github.com/channelcat/sanic/blob/818a8c2196fb14aab3ee30cd2fef845d0b7148ef/sanic/app.py#L794-L800

So therefore the access log is always True

@yunstanford can you double check?

And then we maybe need to add this in the documentation :)

antsbean pushed a commit to antsbean/sanic that referenced this issue Jul 31, 2018
@r0fls r0fls closed this as completed in 6abdf9f Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants