Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2755 from matrix-org/richvdh-patch-1
Browse files Browse the repository at this point in the history
Remove 'verbosity'/'log_file' from generated cfg
  • Loading branch information
richvdh authored Jan 5, 2018
2 parents 6e375f4 + 840f723 commit e6b2466
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions synapse/config/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ def default_config(self, config_dir_path, server_name, **kwargs):
os.path.join(config_dir_path, server_name + ".log.config")
)
return """
# Logging verbosity level. Ignored if log_config is specified.
verbose: 0
# File to write logging to. Ignored if log_config is specified.
log_file: "%(log_file)s"
# A yaml python logging config file
log_config: "%(log_config)s"
""" % locals()
Expand Down Expand Up @@ -150,18 +144,20 @@ def setup_logging(config, use_worker_options=False):
)

if log_config is None:
# We don't have a logfile, so fall back to the 'verbosity' param from
# the config or cmdline. (Note that we generate a log config for new
# installs, so this will be an unusual case)
level = logging.INFO
level_for_storage = logging.INFO
if config.verbosity:
level = logging.DEBUG
if config.verbosity > 1:
level_for_storage = logging.DEBUG

# FIXME: we need a logging.WARN for a -q quiet option
logger = logging.getLogger('')
logger.setLevel(level)

logging.getLogger('synapse.storage').setLevel(level_for_storage)
logging.getLogger('synapse.storage.SQL').setLevel(level_for_storage)

formatter = logging.Formatter(log_format)
if log_file:
Expand Down

0 comments on commit e6b2466

Please sign in to comment.