This commit is contained in:
parent
757d0924ec
commit
4110287efb
@ -74,8 +74,19 @@ app.add_url_rule("/healthz", "healthcheck", view_func=lambda: health.run())
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True)
|
app.run(debug=True)
|
||||||
else:
|
else:
|
||||||
import logging
|
import os
|
||||||
|
|
||||||
gunicorn_logger = logging.getLogger('gunicorn.error')
|
if "gunicorn" in os.environ.get("SERVER_SOFTWARE", ""):
|
||||||
app.logger.handlers = gunicorn_logger.handlers
|
import logging
|
||||||
app.logger.setLevel(gunicorn_logger.level)
|
|
||||||
|
gunicorn_logger = logging.getLogger('gunicorn.error')
|
||||||
|
app.logger.handlers = gunicorn_logger.handlers
|
||||||
|
app.logger.setLevel(gunicorn_logger.level)
|
||||||
|
|
||||||
|
jaeger_logger = logging.getLogger('jaeger_tracing')
|
||||||
|
jaeger_logger.handlers = gunicorn_logger.handlers
|
||||||
|
jaeger_logger.setLevel(gunicorn_logger.level)
|
||||||
|
|
||||||
|
app.logger.info("Gunicorn environment detected!")
|
||||||
|
else:
|
||||||
|
app.logger.info("Not gunicorn")
|
||||||
|
Loading…
Reference in New Issue
Block a user