Is there a way to eliminate the “POST /_dash-update-component HTTP/1.1” messages from being displayed?
Thanks,
Steve
Is there a way to eliminate the “POST /_dash-update-component HTTP/1.1” messages from being displayed?
Thanks,
Steve
try this:
import logging
logging.getLogger('werkzeug').setLevel(logging.ERROR)
we’re considering making this the default in https://github.com/plotly/dash/issues/270
Did this get fixed?
I tried the two lines before defining the app and it doesn’t seem to have any effect. Any thoughts?
import logging
logging.getLogger('werkzeug').setLevel(logging.ERROR)
URL_BASE_PATHNAME = '/'+'example/'
server = Flask(__name__)
app = Dash(name=__name__, server=server,
url_base_pathname=URL_BASE_PATHNAME)
For future me and/or other users, if you’re getting these log messages, they might be coming from uWSGI’s loggers, e.g. messages that start off like this:
Jun 22 15:44:06 172-16-193-97 uwsgi: [pid: 11547...]
If so, you can silence them in your uWSGI configuration, e.g.:
logger = syslog
log-4xx = true
log-5xx = true
disable-logging = true
I’ve tried logging.getLogger("werkzeug").setLevel(logging.ERROR)
and it doesn’t work. Still getting reams of useless "POST /dash/_dash-update-component HTTP/1.1"
logs…
What can be done in 2023?
UPDATE Nov 20, 2023:
I finally solved the problem, I think. It was a Gunicorn problem, not a Dash/Flask logging problem. What I was seeing in Docker were the “access logs”, which looked like this:
[17/Nov/2023:16:28:10 +0000] "POST /dash/_dash-update-component HTTP/1.1" 204 0 "https://example.com/" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
To remove the “access logs” from my Docker log output in production, I just changed my gunicorn.conf.py
settings to the following, where accesslog = None
is the key line:
accesslog = None
errorlog = "-"
loglevel = "error"