Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow silencing of web access logs #2273

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion changedetectionio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,19 @@ def hide_referrer(response):

s_type = socket.AF_INET6 if ipv6_enabled else socket.AF_INET

wsgi_enable_access_log = not strtobool(os.getenv('SILENT_WSGI', 'false'))

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)
eventlet.wsgi.server(eventlet.listen((host, int(port)), s_type), app,
log=logger,
log_output=wsgi_enable_access_log)