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

access logs always sent to syslog #1403

Closed
emilhdiaz opened this issue Dec 3, 2016 · 4 comments
Closed

access logs always sent to syslog #1403

emilhdiaz opened this issue Dec 3, 2016 · 4 comments

Comments

@emilhdiaz
Copy link

emilhdiaz commented Dec 3, 2016

Since gunicorn >=19.5.0 access logs seem to always be sent to syslog (see: #1157). Is there a way to disable this functionality? I've tried to start gunicorn with --access-logfile=None with no luck.

We forward our syslog (which collects stderr and stdout from processes managed by supervisord) to log aggregators like LogEntries, while we separately archive access logs in S3. This new behavior doesn't allow us upgrade our gunicorn since our log aggregator bandwidth is eaten up very quickly by the access logs.

gunicorn configuration:

# What ports/sockets to listen on, and what options for them.
bind = "unix:/srv/www/app/shared/sockets/gunicorn.socket"

# The maximum number of pending connections
backlog = 2048

# What the timeout for killing busy workers is, in seconds
timeout = 60

# How long to wait for requests on a Keep-Alive connection, in seconds
keepalive = 2

# The maxium number of requests a worker will process before restarting
max_requests = 1000

# Whether the app should be pre-loaded
preload_app = False

# How many worker processes
workers = 5

# Type of worker to use
worker_class = "gevent"

# What to do after we fork a worker
def post_fork(server, worker):
    from psycogreen.gevent import patch_psycopg; patch_psycopg()

# Log to syslog
syslog = True
syslog_addr = 'unix:///dev/log#dgram'
syslog_prefix = ''
syslog_facility = 'user'

Meanwhile, starting gunicorn <= 19.4.0 with a invalid value like --access-logfile='blahhhh' will cause the access logs to be written to syslog as well. Starting without the --access-logfile argument will honor the default of None and thus no access logs are written to stdout/stderr/syslog.

@emilhdiaz emilhdiaz changed the title accesslog always sent to syslog access logs always sent to syslog Dec 3, 2016
@benoitc
Copy link
Owner

benoitc commented Jan 27, 2017

@emilhdiaz Sorry for the delay to answer. Indeed the current code is the following:
https://github.com/benoitc/gunicorn/blob/master/gunicorn/glogging.py#L222-L224

So access logs are forcefully enabled when you're using syslogs. Maybe we shouldhave an option to redirect access logs too? Not sure about its naming though.

@hramezani
Copy link
Contributor

PR

@wking
Copy link
Contributor

wking commented Nov 3, 2017

Closable with #1528 landed, or is this staying open until a release is cut including #1528?

@berkerpeksag
Copy link
Collaborator

Good catch, thank you for doing issue triage, @wking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants