mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 02:25:45 +03:00
Merge pull request #2755 from matrix-org/richvdh-patch-1
Remove 'verbosity'/'log_file' from generated cfg
This commit is contained in:
commit
e6b24663e4
1 changed files with 4 additions and 8 deletions
|
@ -79,12 +79,6 @@ class LoggingConfig(Config):
|
||||||
os.path.join(config_dir_path, server_name + ".log.config")
|
os.path.join(config_dir_path, server_name + ".log.config")
|
||||||
)
|
)
|
||||||
return """
|
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
|
# A yaml python logging config file
|
||||||
log_config: "%(log_config)s"
|
log_config: "%(log_config)s"
|
||||||
""" % locals()
|
""" % locals()
|
||||||
|
@ -150,6 +144,9 @@ def setup_logging(config, use_worker_options=False):
|
||||||
)
|
)
|
||||||
|
|
||||||
if log_config is None:
|
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 = logging.INFO
|
||||||
level_for_storage = logging.INFO
|
level_for_storage = logging.INFO
|
||||||
if config.verbosity:
|
if config.verbosity:
|
||||||
|
@ -157,11 +154,10 @@ def setup_logging(config, use_worker_options=False):
|
||||||
if config.verbosity > 1:
|
if config.verbosity > 1:
|
||||||
level_for_storage = logging.DEBUG
|
level_for_storage = logging.DEBUG
|
||||||
|
|
||||||
# FIXME: we need a logging.WARN for a -q quiet option
|
|
||||||
logger = logging.getLogger('')
|
logger = logging.getLogger('')
|
||||||
logger.setLevel(level)
|
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)
|
formatter = logging.Formatter(log_format)
|
||||||
if log_file:
|
if log_file:
|
||||||
|
|
Loading…
Reference in a new issue