Gunicorn doesn't print access log to stdout/stderr #1400

msoedov opened this Issue Nov 22, 2016 · 1 comment


None yet

2 participants

msoedov commented Nov 22, 2016

I'm using containerized gunicorn process which I run by:

CMD gunicorn app:app -w 1 -b 0:44332 -t 300 --log-level debug --threads 5 --access-logfile - --error-logfile -

However I did manage to find an easy way in the docs how to make it print access log to stdout.
--access-logfile - doesn't work as it documented on
Config for gunicorn==19.6.0

[2016-11-22 20:45:57 +0000] [7] [DEBUG] Current configuration:
  secure_scheme_headers: {'X-FORWARDED-PROTOCOL': 'ssl', 'X-FORWARDED-PROTO': 'https', 'X-FORWARDED-SSL': 'on'}
  proxy_protocol: False
  worker_connections: 1000
  statsd_host: None
  max_requests_jitter: 0
  post_fork: <function post_fork at 0x7ff56a1a45f0>
  pythonpath: None
  enable_stdio_inheritance: False
  worker_class: sync
  ssl_version: 3
  suppress_ragged_eofs: True
  syslog: False
  syslog_facility: user
  when_ready: <function when_ready at 0x7ff56a1a4320>
  pre_fork: <function pre_fork at 0x7ff56a1a4488>
  cert_reqs: 0
  preload_app: False
  keepalive: 2
  accesslog: -
  group: 0
  graceful_timeout: 30
  do_handshake_on_connect: False
  spew: False
  workers: 1
  proc_name: None
  sendfile: None
  pidfile: None
  umask: 0
  on_reload: <function on_reload at 0x7ff56a1a41b8>
  pre_exec: <function pre_exec at 0x7ff56a1a4b90>
  worker_tmp_dir: None
  post_worker_init: <function post_worker_init at 0x7ff56a1a4758>
  limit_request_fields: 100
  on_exit: <function on_exit at 0x7ff56a1e62a8>
  config: None
  logconfig: None
  check_config: False
  proxy_allow_ips: ['']
  pre_request: <function pre_request at 0x7ff56a1a4cf8>
  post_request: <function post_request at 0x7ff56a1a4de8>
  user: 0
  forwarded_allow_ips: ['']
  worker_int: <function worker_int at 0x7ff56a1a48c0>
  threads: 5
  max_requests: 0
  limit_request_line: 4094
  access_log_format: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"
  certfile: None
  worker_exit: <function worker_exit at 0x7ff56a1a4f50>
  chdir: /app
  paste: None
  default_proc_name: app:app
  errorlog: -
  loglevel: debug
  capture_output: False
  syslog_addr: udp://localhost:514
  syslog_prefix: None
  daemon: False
  ciphers: TLSv1
  on_starting: <function on_starting at 0x7ff56a1a4050>
  worker_abort: <function worker_abort at 0x7ff56a1a4a28>
  bind: ['0:44332']
  raw_env: []
  reload: False
  limit_request_field_size: 8190
  nworkers_changed: <function nworkers_changed at 0x7ff56a1e6140>
  timeout: 300
  ca_certs: None
  django_settings: None
  tmp_upload_dir: None
  keyfile: None
  backlog: 2048
  logger_class: gunicorn.glogging.Logger

I'm using Gunicorn with Amazon ECS and --access-logfile - works exactly as documented; it prints the accesslog to stderr.

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