Repository navigation
Edit the logging configuration in the admin panel - #1235
Merged
Merged
Conversation
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
Deploying openmudocs with
|
| Latest commit: |
6f08b62
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://93f012e7.openmudocs.pages.dev |
| Branch Preview URL: | https://claude-bold-cannon-kqebfb.openmudocs.pages.dev |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TBmURPWeBRDtB2pMPVznCV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the project board item Logging Configuration: the logging configuration (the
Serilogsection ofappsettings.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:Serilogsection, for sinks, output templates and filters. Invalid JSON is rejected and the file is left as it was.Saving changes only the
Serilogsection and leaves the rest ofappsettings.jsonas it was. Saving reloads the configuration automatically: Serilog already watches the file (reloadOnChangeplusSerilog.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 withSystem.Text.Jsonnodes behind anAsyncLock. It overwrites the file in place instead of replacing it, so a single file mounted into a docker container keeps working.MinimumLevelis written in its short string form and there are no overrides, it stays in that form. That's where Serilog watches it.appsettings.jsonare lost when the file is saved. This is documented.Tests / what I ran
LoggingConfigurationServiceTests(load, save levels while keeping the rest of the file, short form, invalid input, section replace, invalid JSON) and bUnitLoggingConfigurationPageTests.dotnet test tests/MUnique.OpenMU.Web.Tests: 252 passed.-demoand used the page in Chromium (Playwright):MUniquetoDebugin the table and saved.[Debug]entries fromConnectServer.ClientListenerappeared in the log right away, without a restart.Informationin the JSON tab. No more debug entries.Docs
Updated
admin-panel/logs-and-monitoring.md(now with the screenshots, indocs-website/static/img/admin-panel/),admin-panel/authentication.md(administrator rights) anddeployment/startup-parameters.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01TBmURPWeBRDtB2pMPVznCV