Now eventlet.wsgi.Server in "nameko\web\server.py" leave log_output=True
and log=None
So all access log like
127.0.0.1 - * [18/Mar/2017 00:57:12] "GET /health HTTP/1.1" 200 140 0.001000
127.0.0.1 - * [18/Mar/2017 00:57:22] "GET /health HTTP/1.1" 200 140 0.002001
127.0.0.1 - * [18/Mar/2017 00:57:23] "GET /health HTTP/1.1" 200 140 0.001008
fall to stderr...
Inside docker and Kubernetes we send all container logs to stdout/stderr,
and constant flow of non-formatted/unstoppable/non-configurable lines from
health checks - big problem.
Lets explicit configure logger in nameko\web\server.py
def get_wsgi_server(
...
return wsgi.Server(
..., log=getLogger('wsgi')
)
As result - good logs
{"asctime": "2017-03-18 01:05:13,662", "msecs": 662.9447937011719,
"levelname": "INFO", "process": 9304, "module": "wsgi", "lineno": 566,
"args": [], "msg": "127.0.0.1 - * [18/Mar/2017 01:05:13] \"GET /health
HTTP/1.1\" 200 140 0.001000", "request_id": null}
{"asctime": "2017-03-18 01:05:14,888", "msecs": 888.3178234100342,
"levelname": "INFO", "process": 9304, "module": "wsgi", "lineno": 566,
"args": [], "msg": "127.0.0.1 - * [18/Mar/2017 01:05:14] \"GET /health
HTTP/1.1\" 200 140 0.001010", "request_id": null}
{"asctime": "2017-03-18 01:05:16,056", "msecs": 56.3197135925293,
"levelname": "INFO", "process": 9304, "module": "wsgi", "lineno": 566,
"args": [], "msg": "127.0.0.1 - * [18/Mar/2017 01:05:16] \"GET /health
HTTP/1.1\" 200 140 0.001000", "request_id": null}
And control via nameko config
...
LOGGING:
version: 1
...
loggers:
wsgi:
level: INFO
handlers: [console]
propagate: False