Skip to content

Edit the logging configuration in the admin panel - #1235

Merged
sven-n merged 2 commits into
masterfrom
claude/bold-cannon-kqebfb
Oct 18, 2026
Merged

sven-n merged 2 commits into
masterfrom
claude/bold-cannon-kqebfb

Conversation

@sven-n

@sven-n sven-n commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Implements the project board item Logging Configuration: the logging configuration (the Serilog section of appsettings.json) can now be edited in the admin panel, with a UI for the common case.

What it does

New page Logging Configuration (/logging-configuration). It's for administrators only and appears in the all-in-one deployment, next to Log Files:

  • Log Levels tab: a dropdown for the default minimum level, plus a table of levels per source that you can add to, edit and remove from. Empty or duplicate sources are rejected.
  • Advanced (JSON) tab: edits the whole Serilog section, for sinks, output templates and filters. Invalid JSON is rejected and the file is left as it was.

Saving changes only the Serilog section and leaves the rest of appsettings.json as it was. Saving reloads the configuration automatically: Serilog already watches the file (reloadOnChange plus Serilog.Settings.Configuration), so a changed default level or a changed level of an existing source applies immediately. Serilog only reloads levels, though. An added or removed source, and changes to sinks, need a restart. The page and the docs say so.

Screenshots

Implementation notes:

  • LoggingConfigurationService (singleton) reads and writes the file with System.Text.Json nodes behind an AsyncLock. It overwrites the file in place instead of replacing it, so a single file mounted into a docker container keeps working.
  • If MinimumLevel is written in its short string form and there are no overrides, it stays in that form. That's where Serilog watches it.
  • Comments in appsettings.json are lost when the file is saved. This is documented.
  • English and German resources are included. zh-CN falls back to English, which the translation tests allow.

Tests / what I ran

  • New LoggingConfigurationServiceTests (load, save levels while keeping the rest of the file, short form, invalid input, section replace, invalid JSON) and bUnit LoggingConfigurationPageTests.
  • dotnet test tests/MUnique.OpenMU.Web.Tests: 252 passed.
  • Ran the all-in-one server with -demo and used the page in Chromium (Playwright):
    • Set source MUnique to Debug in the table and saved. [Debug] entries from ConnectServer.ClientListener appeared in the log right away, without a restart.
    • Set it back to Information in the JSON tab. No more debug entries.
    • Invalid JSON showed an error toast and left the file unchanged.

Docs

Updated admin-panel/logs-and-monitoring.md (now with the screenshots, in docs-website/static/img/admin-panel/), admin-panel/authentication.md (administrator rights) and deployment/startup-parameters.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TBmURPWeBRDtB2pMPVznCV

Adds the page "Logging Configuration" for administrators in the all-in-one
deployment. It edits the Serilog section of the appsettings.json of the
server process:

* a table with the default minimum level and the levels per source,
* an advanced JSON editor for the whole Serilog section (sinks, templates,
  filters), which rejects invalid JSON.

The rest of the file is kept. Serilog already watches the file, so changed
levels apply without a restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TBmURPWeBRDtB2pMPVznCV
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Deploying openmudocs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6f08b62
Status: ✅  Deploy successful!
Preview URL: https://93f012e7.openmudocs.pages.dev
Branch Preview URL: https://claude-bold-cannon-kqebfb.openmudocs.pages.dev

View logs

@sven-n
sven-n merged commit 3ab25d2 into master Oct 18, 2026
3 of 4 checks passed
@sven-n
sven-n deleted the claude/bold-cannon-kqebfb branch October 18, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants