From c3d11b564b3cfb1e865e6f82998b67d9af3986ad Mon Sep 17 00:00:00 2001 From: Joerg Behrmann Date: Thu, 1 Sep 2022 15:06:44 +0200 Subject: [PATCH] Don't put the servername in the filename of the default logging conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörg Behrmann --- .gitignore | 1 + debian/build_virtualenv | 5 +---- synapse/config/logger.py | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index e58affb241..4f3956552e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ __pycache__/ /*.log /*.log.* /*.log.config +/log.config /*.pid /.python-version /*.signing.key diff --git a/debian/build_virtualenv b/debian/build_virtualenv index f1ec609163..18ad8cb6fd 100755 --- a/debian/build_virtualenv +++ b/debian/build_virtualenv @@ -96,9 +96,6 @@ esac # tweak the pid file location /^pid_file:/ and s#:.*#: "/var/run/matrix-synapse.pid"#; -# tweak the path to the log config -/^log_config:/ and s/SERVERNAME\.log\.config/log.yaml/; - # tweak the path to the media store /^media_store_path:/ and s#/media_store#/media#; @@ -112,7 +109,7 @@ esac # build the log config file "${TARGET_PYTHON}" "${VIRTUALENV_DIR}/bin/generate_log_config" \ - --output-file="${PACKAGE_BUILD_DIR}/etc/matrix-synapse/log.yaml" + --output-file="${PACKAGE_BUILD_DIR}/etc/matrix-synapse/log.config" # add a dependency on the right version of python to substvars. PYPKG=$(basename "$SNAKE") diff --git a/synapse/config/logger.py b/synapse/config/logger.py index 6c1f78f8df..5cfb32d871 100644 --- a/synapse/config/logger.py +++ b/synapse/config/logger.py @@ -147,10 +147,8 @@ class LoggingConfig(Config): self.log_config = self.abspath(config.get("log_config")) self.no_redirect_stdio = config.get("no_redirect_stdio", False) - def generate_config_section( - self, config_dir_path: str, server_name: str, **kwargs: Any - ) -> str: - log_config = os.path.join(config_dir_path, server_name + ".log.config") + def generate_config_section(self, config_dir_path: str, **kwargs: Any) -> str: + log_config = os.path.join(config_dir_path, "log.config") return ( """\ log_config: "%(log_config)s"