Skip to content

Commit

Permalink
Work around eventlet/eventlet#807
Browse files Browse the repository at this point in the history
The WSGI server logs every HTTP response at level INFO, which is
inappropriately verbose. As a workaround, disable response logging at
application log levels above DEBUG.
  • Loading branch information
AndrewKvalheim committed Mar 22, 2024
1 parent d41531a commit e9695d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion changedetectionio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,19 @@ def hide_referrer(response):

s_type = socket.AF_INET6 if ipv6_enabled else socket.AF_INET

wsgi_enable_access_log = logger_level in { 'TRACE', 'DEBUG' }

if ssl_mode:
# @todo finalise SSL config, but this should get you in the right direction if you need it.
eventlet.wsgi.server(eventlet.wrap_ssl(eventlet.listen((host, port), s_type),
log=logger,
log_output=wsgi_enable_access_log,
certfile='cert.pem',
keyfile='privkey.pem',
server_side=True), app)

else:
eventlet.wsgi.server(eventlet.listen((host, int(port)), s_type), app,
log=logger)
log=logger,
log_output=wsgi_enable_access_log)

0 comments on commit e9695d0

Please sign in to comment.