gunicorn
gunicorn copied to clipboard
no access log when gunicorn work class as tornado
I has a gunicorn config as below:
bind = '127.0.0.1:3000'
workers = 2
worker_class = 'tornado'
proc_name = 'dome'
loglevel = 'debug'
pidfile = './gunicorn.pid'
accesslog = './log/access.log'
errorlog = './log/error.log'
raw_env = 'env=dev'
I do not find any access log when debugging.
But I change worker_class as gevent, the access log is work!
Why no access log when the gunicorn work class been set tornado ?
maybe tornado is overriding the log config? I will check
yeah, i have the same issue. basically, i cannot overwrite the default tornado.access logger in gunicorn_logconfig.ini
I couldn't get tornado worker work with gunicorn master and tornado 4.4.2 by the way:
ERROR:tornado.application:Uncaught exception
Traceback (most recent call last):
File "/home/berker/projects/gunicorn/venv34/lib/python3.4/site-packages/tornado/http1connection.py", line 238, in _read_message
delegate.finish()
File "/home/berker/projects/gunicorn/venv34/lib/python3.4/site-packages/tornado/httpserver.py", line 287, in finish
self.server.request_callback(self.request)
File "/home/berker/projects/gunicorn/venv34/lib/python3.4/site-packages/tornado/wsgi.py", line 304, in __call__
request.connection.write_headers(start_line, header_obj, chunk=body)
File "/home/berker/projects/gunicorn/venv34/lib/python3.4/site-packages/tornado/http1connection.py", line 398, in write_headers
data += self._format_chunk(chunk)
File "/home/berker/projects/gunicorn/venv34/lib/python3.4/site-packages/tornado/http1connection.py", line 410, in _format_chunk
"Tried to write more data than Content-Length")
tornado.httputil.HTTPOutputError: Tried to write more data than Content-Length
Is there any ETA for fix of this issue? or any workaround for the same.
I imagine this would involve the following changes:
- [ ] tell tornado to not setup conflicting logging, e.g.
tornado.options.logging = "none" - [ ] patch tornado.wsgi.WSGIContainer to call our handler
- [ ] patch tornado.web.Application to call our handler
- [ ] patch
environ(because we add non-rfc3875 keys such asRAW_URIand glogging will assert they are there) - [ ] forward size, request and response headers to our logging <= tricky without overriding internals / restricting supported versions
For reference, this is what I did to mock up access logs for the tornado worker for my testing purposes: https://github.com/benoitc/gunicorn/pull/3201/files#diff-233ae0d57e7947065c3b18f680f31643c2b97dfefa2665ce2d3afcceaab773e7