Skip to content

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Oct 16, 2025

Be mindful that it's possible to run Synapse multiple times in the same Python process. So we only need to do some part of the logging setup once.

  • We only need to setup the global log record factory and context filter once
  • We only need to redirect Twisted logging once

Background

As part of Element's plan to support a light form of vhosting (virtual host) (multiple instances of Synapse in the same Python process), we're currently diving into the details and implications of running multiple instances of Synapse in the same Python process.

"Per-tenant logging" tracked internally by https://github.com/element-hq/synapse-small-hosts/issues/48

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@MadLittleMods MadLittleMods force-pushed the madlittlemods/one-time-logging-setup branch from e233fc4 to 6397095 Compare October 17, 2025 00:04
Fix `logBeginner` missing

Clarify once for the Python process
@MadLittleMods MadLittleMods force-pushed the madlittlemods/one-time-logging-setup branch from 6397095 to 24d14f1 Compare October 17, 2025 00:06
@MadLittleMods MadLittleMods marked this pull request as ready for review October 17, 2025 01:17
@MadLittleMods MadLittleMods requested a review from a team as a code owner October 17, 2025 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant