feat(ops): structured JSON logging + trace/player scopes + client-intent audit #156
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!156
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/structured-logging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Structured logging for the two servers, aimed at Loki/Grafana and at auditing what a client does (reconstruct a session, spot a modified client).
AddJsonConsole— no env-dependent shape; the environment is only ever a label/field (Promtail addsenv/job/container; the framework logs it at startup). No new dependency. (Localjust devnow also emits JSON, so it's testable locally.)IncludeScopes):ActivityTrackingOptionsputs the request Activity'sTraceId/SpanIdon each log (correlate a whole/wssession); GameSessionHandler wraps the session in aPlayerId/Charscope (filter by player). Plus the framework'sConnectionId/RequestPath.Client intent {Intent}line per client message (Debug), under that scope → setLogging__LogLevel__IsoMmo=Debugfor a full action trail to reconstruct a session or spot odd/rapid actions. Malformed frames now log at Warning (a modified-client tell).docs/deploy.mddocuments the format, Promtail→Loki, the trace/player correlation, and the audit level.How it was tested
Ran the stack locally with
Logging__LogLevel__IsoMmo=Debug, logged in via the debug harness and moved around. Verified in the captured stdout:Timestamp,LogLevel,Category,Message,Statebag of template fields,Scopes).Client intent MoveRequestcarry, in scopes, the sameTraceIdfor the connection plusPlayerId+Char.ASPNETCORE_ENVIRONMENT=Production(the Docker default) emits the identical JSON.just lint(zero warnings) +just test(all projects green) + whole solution builds.Checklist
just lintpasses (zero warnings)just testis greendocs/deploy.md)