Skip to content

WebHost: use canonical LOGS_FOLDER for room logs#6273

Open
patrickwehbe wants to merge 1 commit into
ArchipelagoMW:mainfrom
patrickwehbe:fix/webhost-logs-folder
Open

WebHost: use canonical LOGS_FOLDER for room logs#6273
patrickwehbe wants to merge 1 commit into
ArchipelagoMW:mainfrom
patrickwehbe:fix/webhost-logs-folder

Conversation

@patrickwehbe

Copy link
Copy Markdown
Contributor

What is this fixing or adding?

Room logs were written and read using three different path computations:

  • customserver.py wrote them under Utils.user_path("logs")
  • misc.py read them from the implicit relative "logs" (in two places)
  • WebHostLib/__init__.py defines LOGS_FOLDER = os.path.relpath("logs")

When the WebHost is run by itself (self-hosted), user_path("logs") and the relative "logs" resolve to different directories, so room logs were written where the /log views could not find them.

This reuses the canonical WebHostLib.LOGS_FOLDER in all three places so the writer and both readers always agree. (The issue also suggests making the location configurable in config.yaml like UPLOADS_FOLDER; that is left out here to keep the fix minimal and focused.)

Fixes #6046.

How was this tested?

Confirmed WebHostLib.LOGS_FOLDER resolves to the canonical relative logs path and that misc.py references it after the change; both edited files pass py_compile. The change is otherwise inspection-level, since WebHost log-file routing isn't unit-testable here -- it aligns the single writer (customserver) and the readers (misc) on one constant, which the reporter confirmed fixes self-hosted logging.

Room logs were written and read using three different path computations:
customserver.py wrote under Utils.user_path("logs"), misc.py read from the
implicit relative "logs" (in two places), and WebHostLib defines
LOGS_FOLDER = os.path.relpath("logs"). When the WebHost is run by itself
(self-hosted) these resolve to different directories, so room logs were
written where the readers could not find them.

Reuse the canonical WebHostLib.LOGS_FOLDER in all three places so the writer
and both readers always agree.

Fixes ArchipelagoMW#6046.
@github-actions github-actions Bot added affects: webhost Issues/PRs that touch webhost and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Jun 19, 2026

@silasary silasary left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects: webhost Issues/PRs that touch webhost and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebHost: Logs directory is incorrectly computed in different places

2 participants