mirror of
https://github.com/mozilla-services/syncserver
synced 2024-10-30 09:20:32 +00:00
Merge pull request #228 from sbraz/docker_debug
Docker: add an environment variable to activate debug logs, fixes #164
This commit is contained in:
commit
4fa33bf8f5
@ -119,6 +119,7 @@ environment variables, like this::
|
||||
-e SYNCSERVER_SQLURI=sqlite:////tmp/syncserver.db \
|
||||
-e SYNCSERVER_BATCH_UPLOAD_ENABLED=true \
|
||||
-e SYNCSERVER_FORCE_WSGI_ENVIRON=false \
|
||||
-e SYNCSERVER_DEBUG_ENABLED=true \
|
||||
-e PORT=5000 \
|
||||
mozilla/syncserver:latest
|
||||
|
||||
|
@ -143,7 +143,10 @@ def includeme(config):
|
||||
# Default to basic logging config.
|
||||
root_logger = logging.getLogger("")
|
||||
if not root_logger.handlers:
|
||||
logging.basicConfig(level=logging.WARN)
|
||||
if settings.get("syncserver.debug_enabled"):
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
else:
|
||||
logging.basicConfig(level=logging.WARN)
|
||||
if "fxa.metrics_uid_secret_key" not in settings:
|
||||
# Default to a randomly-generated secret.
|
||||
# This setting isn't useful in a self-hosted setup
|
||||
@ -191,6 +194,9 @@ def import_settings_from_environment_variables(settings, environ=None):
|
||||
("SYNCSERVER_BATCH_UPLOAD_ENABLED",
|
||||
"storage.batch_upload_enabled",
|
||||
str_to_bool),
|
||||
("SYNCSERVER_DEBUG_ENABLED",
|
||||
"syncserver.debug_enabled",
|
||||
str_to_bool),
|
||||
)
|
||||
if "SYNCSERVER_SECRET_FILE" in environ:
|
||||
settings["syncserver.secret"] = \
|
||||
|
Loading…
Reference in New Issue
Block a user