Skip to content

Commit

Permalink
Allow configuring the log level
Browse files Browse the repository at this point in the history
  • Loading branch information
mprahl committed Sep 17, 2019
1 parent 443d603 commit d428d3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions estuary/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def load_config(app):

for env_name in (
'LDAP_CA_CERTIFICATE', 'LDAP_GROUP_MEMBERSHIP_ATTRIBUTE', 'LDAP_URI',
'LDAP_EXCEPTIONS_GROUP_DN', 'NEO4J_URI', 'OIDC_CLIENT_ID', 'OIDC_CLIENT_SECRET',
'OIDC_INTROSPECT_URL', 'SECRET_KEY',
'LDAP_EXCEPTIONS_GROUP_DN', 'LOG_LEVEL', 'NEO4J_URI', 'OIDC_CLIENT_ID',
'OIDC_CLIENT_SECRET', 'OIDC_INTROSPECT_URL', 'SECRET_KEY',
):
if os.environ.get(env_name):
app.config[env_name] = os.environ[env_name]
Expand Down
1 change: 1 addition & 0 deletions estuary/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Config(object):
EMPLOYEE_TYPES = []
LDAP_CA_CERTIFICATE = '/etc/pki/tls/certs/ca-bundle.crt'
LDAP_GROUP_MEMBERSHIP_ATTRIBUTE = 'uniqueMember'
LOG_LEVEL = 'INFO'


class ProdConfig(Config):
Expand Down
3 changes: 1 addition & 2 deletions estuary/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def init_logging(app):
:param flask.Flask app: a Flask application object
"""
log_level = logging.DEBUG if app.debug else logging.INFO
log_to_stdout(level=log_level)
log_to_stdout(level=app.config['LOG_LEVEL'])
# In general we want to see everything from our own code,
# but not detailed debug messages from third-party libraries.
# Note that the log level on the handler above controls what
Expand Down

0 comments on commit d428d3b

Please sign in to comment.