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.
# 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.