Skip to content

[codex] Add live server log streaming diagnostics#7438

Merged
sfmskywalker merged 25 commits into
mainfrom
003-live-server-logs
May 10, 2026
Merged

[codex] Add live server log streaming diagnostics#7438
sfmskywalker merged 25 commits into
mainfrom
003-live-server-logs

Conversation

@sfmskywalker
Copy link
Copy Markdown
Member

Summary

Adds an Elsa.Diagnostics module for live backend server log streaming. The module captures ILogger events, redacts sensitive values, stores a bounded recent-log buffer, exposes recent-log and source endpoints, and streams live events over SignalR for Studio.

Highlights

  • Adds diagnostics contracts, models, options, feature registration, REST endpoints, SignalR hub, logger provider, redaction, source registry, and in-memory provider.
  • Supports filtering by level, category, text, tenant, workflow, trace/correlation, source, and time.
  • Tracks source metadata for clustered/containerized deployments and broadcasts new source notifications.
  • Adds sample host wiring behind a disabled useServerLogStreaming flag.
  • Adds Spec Kit docs, quickstart validation notes, and diagnostics README.

Validation

  • dotnet test test/unit/Elsa.Diagnostics.UnitTests/Elsa.Diagnostics.UnitTests.csproj --no-restore passed, 20 tests.
  • dotnet build src/modules/Elsa.Diagnostics/Elsa.Diagnostics.csproj --no-restore passed.
  • dotnet restore src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj passed.
  • dotnet build src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj --no-restore passed.
  • dotnet test test/integration/Elsa.Diagnostics.IntegrationTests/Elsa.Diagnostics.IntegrationTests.csproj --no-restore exited successfully, but the integration project currently has no discoverable tests.

Existing repository warnings remain, including NU1903 for Snappier and nullable/analyzer warnings in unrelated modules.

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 8, 2026

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
32583717 Triggered Generic Password 229997e test/unit/Elsa.Diagnostics.UnitTests/Redaction/ServerLogRedactorTests.cs View secret
32583717 Triggered Generic Password ec8f325 test/unit/Elsa.Diagnostics.UnitTests/Logging/ServerLogLoggerProviderTests.cs View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Copy Markdown
Member Author

Paired Studio PR: elsa-workflows/elsa-studio#810

@sfmskywalker sfmskywalker marked this pull request as ready for review May 8, 2026 13:23
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 8, 2026

Greptile Summary

This PR introduces Elsa.Diagnostics, a new module that captures ILogger events via a custom ILoggerProvider, redacts sensitive values, stores a bounded recent-log ring buffer, exposes REST endpoints, and streams live events over SignalR to Elsa Studio. The feature is opt-in and gated behind a useServerLogStreaming flag in the sample host.

  • Core pipeline: ServerLogLogger captures every log call, redacts it via regex/name matching, and fire-and-forgets PublishAsync into InMemoryServerLogProvider, which fans out to bounded per-subscriber channels and a RingBuffer for recent-log queries.
  • Real-time delivery: ServerLogSubscriptionManager spawns a background Task per SignalR connection that streams from the provider and pushes events via IHubContext; ServerLogSourceRegistry tracks source metadata and broadcasts source-change events to all connected clients.
  • ReceiveDroppedEventsAsync gap: IServerLogsClient declares this method so Studio can detect stream gaps, but neither InMemoryServerLogProvider nor ServerLogSubscriptionManager ever calls it — clients will silently see incomplete log streams when the bounded channel overflows.

Confidence Score: 4/5

Safe to merge for most deployments; the feature is disabled by default and only activated behind an explicit opt-in flag, limiting blast radius.

The module is well-structured and the core log-capture, redaction, and ring-buffer paths work correctly. The main gap is that IServerLogsClient.ReceiveDroppedEventsAsync is part of the published contract but is never invoked anywhere in the implementation, so Studio clients expecting drop notifications will silently see incomplete streams whenever the bounded subscriber channel overflows.

ServerLogSubscriptionManager.cs — the unimplemented ReceiveDroppedEventsAsync notification and the debug-level error swallowing both live here. ServerLogSourceRegistry.cs — remote-source seeding logic copies local process metadata.

Important Files Changed

Filename Overview
src/modules/Elsa.Diagnostics/RealTime/ServerLogSubscriptionManager.cs Manages per-connection log subscriptions and source broadcasts; ReceiveDroppedEventsAsync is defined in the client interface but never invoked, so clients cannot detect channel-drop gaps; unexpected streaming errors are swallowed at Debug level.
src/modules/Elsa.Diagnostics/RealTime/ServerLogsHub.cs SignalR hub wrapping subscription manager; filter validation is correct, disconnect cleanup is handled.
src/modules/Elsa.Diagnostics/Providers/InMemory/InMemoryServerLogProvider.cs Bounded in-memory log store and subscriber fan-out; TryWrite silently drops overflow items with no notification to subscribers; ordering logic is correct.
src/modules/Elsa.Diagnostics/Services/ServerLogSourceRegistry.cs ConcurrentDictionary-based registry with optimistic-update loop; new remote sources inherit local process metadata (ServiceName, PodName, etc.) which is misleading in clustered deployments.
src/modules/Elsa.Diagnostics/Services/ServerLogRedactor.cs Regex-based redaction for sensitive fields and patterns; patterns are compiled at startup; logic is straightforward and correct.
src/modules/Elsa.Diagnostics/Logging/ServerLogLogger.cs ILogger implementation that captures and publishes log events; PublishAsync is fire-and-forget (required by the synchronous ILogger.Log contract); sequence counter is per-category-instance and thread-safe.
src/modules/Elsa.Diagnostics/Providers/InMemory/RingBuffer.cs Thread-safe bounded ring buffer using Queue and lock; correct eviction and dropped-count tracking.
src/modules/Elsa.Diagnostics/Services/ServerLogFilterEvaluator.cs Pure static filter evaluator; handles all documented filter dimensions correctly; null-safe for optional fields.
src/modules/Elsa.Diagnostics/Features/ServerLogStreamingFeature.cs Wires DI registrations and SignalR for the diagnostics module; all services registered as Singleton, consistent with the feature's design.
src/modules/Elsa.Diagnostics/Extensions/ApplicationBuilderExtensions.cs Maps the SignalR hub with authorization guard; correctly skips auth when security is disabled.

Sequence Diagram

sequenceDiagram
    participant App as Application Code
    participant SLL as ServerLogLogger
    participant Red as ServerLogRedactor
    participant IMLP as InMemoryServerLogProvider
    participant RB as RingBuffer
    participant SM as ServerLogSubscriptionManager
    participant Hub as ServerLogsHub (SignalR)
    participant Studio as Elsa Studio

    App->>SLL: ILogger.Log(level, message, ...)
    SLL->>Red: Redact(logEvent)
    Red-->>SLL: redacted event
    SLL->>IMLP: PublishAsync(redacted) [fire-and-forget]
    IMLP->>RB: Add(logEvent)
    IMLP->>IMLP: Fan-out to subscriber channels
    IMLP-->>SM: Channel yields logEvent
    SM->>Hub: IHubContext.Clients.Client(connId).ReceiveLogEventAsync(logEvent)
    Hub-->>Studio: SignalR push

    Studio->>Hub: SubscribeAsync(filter)
    Hub->>SM: SubscribeAsync(connectionId, filter)
    SM->>IMLP: SubscribeAsync(filter) [background task]

    Studio->>Hub: GET /server-logs/recent
    Hub->>IMLP: GetRecentAsync(filter)
    IMLP->>RB: Snapshot()
    RB-->>IMLP: items
    IMLP-->>Hub: RecentServerLogsResult
    Hub-->>Studio: JSON response
Loading
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
src/modules/Elsa.Diagnostics/RealTime/ServerLogSubscriptionManager.cs:1-118
`ReceiveDroppedEventsAsync` defined but never called — dropped events silently disappear

`IServerLogsClient` declares `ReceiveDroppedEventsAsync` to notify connected Studio clients when log events are dropped from a subscriber's bounded channel. However, `StreamAsync` only forwards events that pass through the channel — when `BoundedChannelFullMode.DropOldest` discards an item, no notification is sent. Clients therefore have no way to detect gaps in the log stream, which defeats the purpose of the `ReceiveDroppedEventsAsync` contract. A typical fix is to wrap `channel.Reader.ReadAllAsync` with a dropped-count comparison, or use a `Channel.Writer.OnFull` callback to fire the notification when the bounded channel is full.

### Issue 2 of 3
src/modules/Elsa.Diagnostics/RealTime/ServerLogSubscriptionManager.cs:75-78
Unexpected streaming errors are swallowed at `Debug` level, making silent failures invisible in production. When a subscriber's `ReceiveLogEventAsync` call fails (e.g., due to a transient SignalR error or serialization problem), the exception is logged at `Debug` — a level that is almost always disabled in staging and production environments. The error will go unnoticed by operators and the subscription will silently stop delivering events to that client.

```suggestion
        catch (Exception e)
        {
            _logger.LogWarning(e, "Server log subscription for connection {ConnectionId} stopped unexpectedly", connectionId);
        }
```

### Issue 3 of 3
src/modules/Elsa.Diagnostics/Services/ServerLogSourceRegistry.cs:46-57
Remote source entries are created with local process metadata

When `MarkSeen` encounters a `sourceId` it hasn't seen before, it seeds the new `ServerLogSource` record with `Current with { Id = sourceId, ... }`. The `with` expression copies all un-overridden properties from the current process's source — including `ServiceName`, `PodName`, `Namespace`, `ContainerName`, and `NodeName`. In a clustered or multi-process deployment backed by a shared `IServerLogProvider`, the source list returned to Studio would display the local node's pod/container/namespace metadata for every remote node, misleading operators trying to distinguish instances.

Reviews (1): Last reviewed commit: "Record diagnostics validation results" | Re-trigger Greptile

Comment thread src/modules/Elsa.Diagnostics/RealTime/ServerLogSubscriptionManager.cs Outdated
Comment thread src/modules/Elsa.ServerLogs/Services/ServerLogSourceRegistry.cs Outdated
@sfmskywalker
Copy link
Copy Markdown
Member Author

Reviewed the GitGuardian alert. The flagged values are synthetic test fixture strings, not live credentials, so there is no rotation action needed. I left the published branch history intact to avoid a disruptive rewrite; if maintainers require the scanner alert to clear from history, we can handle that as a separate history-rewrite step.

* Specify diagnostics structured logs refactor

* docs: clarify structured logs spec

* docs: plan diagnostics structured logs

* docs: add diagnostics structured logs tasks

* refactor: rename server logs to diagnostics structured logs

* Refactor PostgreSql persistence features to use centralized entity model handler registration.

* Refactor EFCore persistence features to centralize entity model handler registration for MySql, Sqlite, and Oracle providers.

* Integrate structured logs by renaming server logs, adjusting appsettings, and updating project references.

* Switch from PostgreSQL to Sqlite for workflow and identity persistence, update appsettings configuration.
@sfmskywalker sfmskywalker merged commit ab3e46b into main May 10, 2026
8 of 9 checks passed
@sfmskywalker sfmskywalker deleted the 003-live-server-logs branch May 10, 2026 22:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new Elsa.Diagnostics.StructuredLogs module to stream live, redacted ILogger events (recent backfill + live tail) to Elsa Studio via REST and SignalR, along with supporting infrastructure (filtering, in-memory buffering, source tracking) and accompanying tests/spec documentation. It also includes some persistence-provider refactoring (centralizing EF Core model-creating handler registration), bumps CShells packages, and updates Spec Kit integration assets.

Changes:

  • Add Elsa.Diagnostics.StructuredLogs module (contracts/models/options, logger provider + redaction, in-memory provider, REST endpoints, SignalR hub + subscription manager, shell feature wiring, docs).
  • Add unit + integration tests for structured logs behavior (filtering, redaction, sources, ring buffer, logger provider).
  • Refactor EFCore persistence providers (Sqlite/MySql/PostgreSql) to register entity model creating handlers via shared extension methods; update Oracle options configuration helper; update app wiring/sample configs and Spec Kit integration files.

Reviewed changes

Copilot reviewed 173 out of 173 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/StructuredLogsNamingTests.cs Verifies permission and hub route constants.
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/Sources/StructuredLogSourceRegistryTests.cs Tests source identity + heartbeat/staleness behavior.
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/Redaction/StructuredLogRedactorTests.cs Tests sensitive-name and sensitive-text redaction.
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/Logging/StructuredLogLoggerProviderTests.cs Tests logging capture, templates, scopes, redaction, and internal-category filtering.
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/InMemory/RingBufferTests.cs Tests bounded ring buffer behavior and validation.
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/InMemory/InMemoryStructuredLogProviderTests.cs Tests recent-log query behavior and live subscription semantics.
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/InMemory/InMemoryStructuredLogProviderSourceTests.cs Tests multi-source merge ordering and source filtering.
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/Filtering/StructuredLogFilterTests.cs Tests filter matching across message/template/scopes/properties.
test/unit/Elsa.Diagnostics.StructuredLogs.UnitTests/Elsa.Diagnostics.StructuredLogs.UnitTests.csproj Adds unit test project referencing the new module.
test/integration/Elsa.Diagnostics.StructuredLogs.IntegrationTests/Usings.cs Adds global xUnit using for integration tests.
test/integration/Elsa.Diagnostics.StructuredLogs.IntegrationTests/StructuredLogsModuleTests.cs Integration smoke tests for feature wiring and README expectations.
test/integration/Elsa.Diagnostics.StructuredLogs.IntegrationTests/Elsa.Diagnostics.StructuredLogs.IntegrationTests.csproj Adds integration test project and shared integration reference.
src/modules/Elsa.Persistence.EFCore.Sqlite/SqliteProvidersExtensions.cs Extracts Sqlite entity-model handler registration into a reusable DI extension.
src/modules/Elsa.Persistence.EFCore.Sqlite/ShellFeatures/Tenants/SqliteTenantPersistenceShellFeature.cs Uses centralized Sqlite handler registration.
src/modules/Elsa.Persistence.EFCore.Sqlite/ShellFeatures/Runtime/SqliteWorkflowRuntimePersistenceShellFeature.cs Uses centralized Sqlite handler registration.
src/modules/Elsa.Persistence.EFCore.Sqlite/ShellFeatures/Management/SqliteWorkflowInstancePersistenceShellFeature.cs Uses centralized Sqlite handler registration.
src/modules/Elsa.Persistence.EFCore.Sqlite/ShellFeatures/Management/SqliteWorkflowDefinitionPersistenceShellFeature.cs Uses centralized Sqlite handler registration.
src/modules/Elsa.Persistence.EFCore.Sqlite/ShellFeatures/Labels/SqliteLabelPersistenceShellFeature.cs Uses centralized Sqlite handler registration.
src/modules/Elsa.Persistence.EFCore.Sqlite/ShellFeatures/Identity/SqliteIdentityPersistenceShellFeature.cs Uses centralized Sqlite handler registration.
src/modules/Elsa.Persistence.EFCore.Sqlite/ShellFeatures/Alterations/SqliteAlterationsPersistenceShellFeature.cs Uses centralized Sqlite handler registration.
src/modules/Elsa.Persistence.EFCore.Sqlite/DbContextFactories.cs Ensures design-time factories also register Sqlite model-creating handlers.
src/modules/Elsa.Persistence.EFCore.PostgreSql/ShellFeatures/Tenants/PostgreSqlTenantPersistenceFeature.cs Adds PostgreSql handler registration during shell feature configuration (and renames type).
src/modules/Elsa.Persistence.EFCore.PostgreSql/ShellFeatures/Runtime/PostgreSqlWorkflowRuntimePersistenceFeature.cs Adds PostgreSql handler registration during shell feature configuration (and renames type).
src/modules/Elsa.Persistence.EFCore.PostgreSql/ShellFeatures/PostgreSqlWorkflowPersistenceFeature.cs Updates combined persistence shell feature to depend on concrete feature types.
src/modules/Elsa.Persistence.EFCore.PostgreSql/ShellFeatures/Management/PostgreSqlWorkflowInstancePersistenceFeature.cs Adds PostgreSql handler registration during shell feature configuration (and renames type).
src/modules/Elsa.Persistence.EFCore.PostgreSql/ShellFeatures/Management/PostgreSqlWorkflowDefinitionPersistenceFeature.cs Adds PostgreSql handler registration during shell feature configuration (and renames type).
src/modules/Elsa.Persistence.EFCore.PostgreSql/ShellFeatures/Labels/PostgreSqlLabelPersistenceFeature.cs Adds PostgreSql handler registration during shell feature configuration (and renames type).
src/modules/Elsa.Persistence.EFCore.PostgreSql/ShellFeatures/Identity/PostgreSqlIdentityPersistenceFeature.cs Adds PostgreSql handler registration during shell feature configuration (and renames type).
src/modules/Elsa.Persistence.EFCore.PostgreSql/ShellFeatures/Alterations/PostgreSqlAlterationsPersistenceFeature.cs Adds PostgreSql handler registration during shell feature configuration (and renames type).
src/modules/Elsa.Persistence.EFCore.PostgreSql/PostgreSqlProvidersExtensions.cs Extracts PostgreSql entity-model handler registration into a reusable DI extension.
src/modules/Elsa.Persistence.EFCore.Oracle/ShellFeatures/Tenants/OracleTenantPersistenceShellFeature.cs Ensures Oracle options are configured via ConfigureOracle() before use.
src/modules/Elsa.Persistence.EFCore.Oracle/ShellFeatures/Runtime/OracleWorkflowRuntimePersistenceShellFeature.cs Ensures Oracle options are configured via ConfigureOracle() before use.
src/modules/Elsa.Persistence.EFCore.Oracle/ShellFeatures/Management/OracleWorkflowInstancePersistenceShellFeature.cs Ensures Oracle options are configured via ConfigureOracle() before use.
src/modules/Elsa.Persistence.EFCore.Oracle/ShellFeatures/Management/OracleWorkflowDefinitionPersistenceShellFeature.cs Ensures Oracle options are configured via ConfigureOracle() before use.
src/modules/Elsa.Persistence.EFCore.Oracle/ShellFeatures/Labels/OracleLabelPersistenceShellFeature.cs Ensures Oracle options are configured via ConfigureOracle() before use.
src/modules/Elsa.Persistence.EFCore.Oracle/ShellFeatures/Identity/OracleIdentityPersistenceShellFeature.cs Ensures Oracle options are configured via ConfigureOracle() before use.
src/modules/Elsa.Persistence.EFCore.Oracle/ShellFeatures/Alterations/OracleAlterationsPersistenceShellFeature.cs Ensures Oracle options are configured via ConfigureOracle() before use.
src/modules/Elsa.Persistence.EFCore.Oracle/OracleProvidersExtensions.cs Introduces ConfigureOracle(ElsaDbContextOptions?) and keeps Configure() as a compatibility alias.
src/modules/Elsa.Persistence.EFCore.Oracle/DbContextFactories.cs Updates Oracle design-time factory to pass configured Oracle options.
src/modules/Elsa.Persistence.EFCore.MySql/ShellFeatures/Tenants/MySqlTenantPersistenceShellFeature.cs Registers MySql entity-model handlers during shell feature configuration.
src/modules/Elsa.Persistence.EFCore.MySql/ShellFeatures/Runtime/MySqlWorkflowRuntimePersistenceShellFeature.cs Registers MySql entity-model handlers during shell feature configuration.
src/modules/Elsa.Persistence.EFCore.MySql/ShellFeatures/Management/MySqlWorkflowInstancePersistenceShellFeature.cs Registers MySql entity-model handlers during shell feature configuration.
src/modules/Elsa.Persistence.EFCore.MySql/ShellFeatures/Management/MySqlWorkflowDefinitionPersistenceShellFeature.cs Registers MySql entity-model handlers during shell feature configuration.
src/modules/Elsa.Persistence.EFCore.MySql/ShellFeatures/Labels/MySqlLabelPersistenceShellFeature.cs Registers MySql entity-model handlers during shell feature configuration.
src/modules/Elsa.Persistence.EFCore.MySql/ShellFeatures/Identity/MySqlIdentityPersistenceShellFeature.cs Registers MySql entity-model handlers during shell feature configuration.
src/modules/Elsa.Persistence.EFCore.MySql/ShellFeatures/Alterations/MySqlAlterationsPersistenceShellFeature.cs Registers MySql entity-model handlers during shell feature configuration.
src/modules/Elsa.Persistence.EFCore.MySql/MySqlProvidersExtensions.cs Extracts MySql entity-model handler registration into a reusable DI extension.
src/modules/Elsa.Persistence.EFCore.MySql/DbContextFactories.cs Ensures design-time factories also register MySql model-creating handlers.
src/modules/Elsa.Diagnostics.StructuredLogs/ShellFeatures/StructuredLogsFeature.cs Adds shell feature for enabling/configuring structured logs in CShells hosts.
src/modules/Elsa.Diagnostics.StructuredLogs/Services/StructuredLogSourceRegistry.cs Implements source identity tracking, heartbeat updates, and stale source listing.
src/modules/Elsa.Diagnostics.StructuredLogs/Services/StructuredLogRedactor.cs Implements sensitive-name and sensitive-text redaction for events.
src/modules/Elsa.Diagnostics.StructuredLogs/Services/StructuredLogFilterEvaluator.cs Implements filter matching logic for queries/subscriptions.
src/modules/Elsa.Diagnostics.StructuredLogs/RealTime/StructuredLogSubscriptionManager.cs Manages SignalR subscriptions and streaming (including dropped summaries).
src/modules/Elsa.Diagnostics.StructuredLogs/RealTime/StructuredLogsHub.cs Adds SignalR hub to subscribe/update/unsubscribe to live structured logs.
src/modules/Elsa.Diagnostics.StructuredLogs/RealTime/IStructuredLogsClient.cs Defines server-to-client SignalR contract for events/drops/sources.
src/modules/Elsa.Diagnostics.StructuredLogs/README.md Adds module usage, authorization, redaction, and deployment notes.
src/modules/Elsa.Diagnostics.StructuredLogs/Providers/InMemory/RingBuffer.cs Adds bounded in-memory ring buffer implementation.
src/modules/Elsa.Diagnostics.StructuredLogs/Providers/InMemory/InMemoryStructuredLogProvider.cs Adds in-memory provider with recent buffer + live subscriptions.
src/modules/Elsa.Diagnostics.StructuredLogs/Permissions/StructuredLogsPermissions.cs Defines permission constant for reading structured logs.
src/modules/Elsa.Diagnostics.StructuredLogs/Options/StructuredLogsOptions.cs Adds module options for capacity, filtering, and redaction patterns.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/StructuredLogStreamItem.cs DTO for streaming either a log event or dropped summary.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/StructuredLogSourceStatus.cs Source health/status enum.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/StructuredLogSource.cs Source metadata DTO.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/StructuredLogLevel.cs Log level enum for structured logs.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/StructuredLogFilter.cs Filter DTO for recent queries and subscriptions.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/StructuredLogException.cs Exception DTO used in structured log events.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/StructuredLogEvent.cs Structured log event DTO.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/StructuredLogDroppedEventSummary.cs Dropped-event summary DTO.
src/modules/Elsa.Diagnostics.StructuredLogs/Models/RecentStructuredLogsResult.cs Recent query response DTO.
src/modules/Elsa.Diagnostics.StructuredLogs/Logging/StructuredLogLoggerProvider.cs Registers an ILoggerProvider that publishes redacted structured log events.
src/modules/Elsa.Diagnostics.StructuredLogs/FodyWeavers.xml Enables ConfigureAwait Fody weaving for the module.
src/modules/Elsa.Diagnostics.StructuredLogs/Features/StructuredLogsFeature.cs Adds Elsa module feature for FastEndpoints discovery + service wiring.
src/modules/Elsa.Diagnostics.StructuredLogs/Extensions/ServiceCollectionExtensions.cs Adds DI wiring for providers, SignalR, options, and logger provider.
src/modules/Elsa.Diagnostics.StructuredLogs/Extensions/ModuleExtensions.cs Adds UseStructuredLogs module extension for feature registration.
src/modules/Elsa.Diagnostics.StructuredLogs/Extensions/EndpointRouteBuilderExtensions.cs Adds hub mapping and defines hub route constant.
src/modules/Elsa.Diagnostics.StructuredLogs/Extensions/ApplicationBuilderExtensions.cs Adds app-level mapping method for the structured logs hub.
src/modules/Elsa.Diagnostics.StructuredLogs/Endpoints/StructuredLogs/Sources/Endpoint.cs Adds endpoint to list structured log sources (permission-protected).
src/modules/Elsa.Diagnostics.StructuredLogs/Endpoints/StructuredLogs/Recent/Endpoint.cs Adds endpoint to query recent logs (permission-protected).
src/modules/Elsa.Diagnostics.StructuredLogs/Elsa.Diagnostics.StructuredLogs.csproj Introduces the new module project.
src/modules/Elsa.Diagnostics.StructuredLogs/Contracts/IStructuredLogStreamProvider.cs Adds stream-provider contract including dropped summaries.
src/modules/Elsa.Diagnostics.StructuredLogs/Contracts/IStructuredLogSourceRegistry.cs Adds source registry contract.
src/modules/Elsa.Diagnostics.StructuredLogs/Contracts/IStructuredLogRedactor.cs Adds redactor contract.
src/modules/Elsa.Diagnostics.StructuredLogs/Contracts/IStructuredLogProvider.cs Adds provider contract for publish/recent/subscribe/sources.
src/apps/Elsa.Server.Web/Program.cs Adds opt-in wiring for UseStructuredLogs() and app.UseStructuredLogs().
src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj References the new structured logs module.
src/apps/Elsa.ModularServer.Web/Elsa.ModularServer.Web.csproj References structured logs and additional modules (e.g., PostgreSql persistence).
src/apps/Elsa.ModularServer.Web/appsettings.json Updates CShells config schema and enables structured logs feature config section.
src/apps/Elsa.ModularServer.Web/appsettings.Development.json Adjusts development logging levels.
specs/004-diagnostics-structured-logs/research.md Adds design decisions and rationale for structured logs diagnostics module.
specs/004-diagnostics-structured-logs/quickstart.md Adds setup instructions and validation commands for structured logs module.
specs/004-diagnostics-structured-logs/data-model.md Documents intended structured logs DTOs and invariants.
specs/004-diagnostics-structured-logs/contracts/signalr-hub.md Documents SignalR hub route and client/server methods.
specs/004-diagnostics-structured-logs/contracts/rest-api.md Documents REST routes and example payloads.
specs/004-diagnostics-structured-logs/contracts/provider-contract.md Documents provider/redactor/source registry contracts.
specs/004-diagnostics-structured-logs/checklists/requirements.md Adds requirements checklist for the diagnostics structured logs spec.
specs/003-live-server-logs/research.md Adds prior research doc for live server logs (historical context).
specs/003-live-server-logs/quickstart.md Adds prior quickstart doc for live server logs (historical context).
specs/003-live-server-logs/data-model.md Adds prior data model doc for live server logs (historical context).
specs/003-live-server-logs/contracts/signalr-hub.md Adds prior SignalR hub contract doc for live server logs (historical context).
specs/003-live-server-logs/contracts/rest-api.md Adds prior REST contract doc for live server logs (historical context).
specs/003-live-server-logs/contracts/provider-contract.md Adds prior provider contract doc for live server logs (historical context).
specs/003-live-server-logs/checklists/requirements.md Adds prior requirements checklist doc for live server logs (historical context).
Directory.Packages.props Bumps CShells packages from 0.0.18 to 0.0.20.
AGENTS.md Adds Spec Kit plan reference and updates “Active Technologies/Recent Changes”.
.specify/workflows/workflow-registry.json Registers bundled Spec Kit workflow metadata.
.specify/workflows/speckit/workflow.yml Adds the Spec Kit workflow definition.
.specify/templates/tasks-template.md Updates command references to /speckit-tasks.
.specify/templates/spec-template.md Adds an “Assumptions” section scaffold.
.specify/templates/plan-template.md Updates command references to /speckit-plan and related naming.
.specify/templates/checklist-template.md Updates command references to /speckit-checklist.
.specify/scripts/bash/setup-tasks.sh Adds script for tasks setup + template resolution (with JSON output option).
.specify/scripts/bash/setup-plan.sh Improves template resolution and JSON output handling.
.specify/scripts/bash/check-prerequisites.sh Improves JSON output handling and safer eval of path outputs.
.specify/integrations/speckit.manifest.json Updates Spec Kit manifest version and tracked files.
.specify/integrations/codex.manifest.json Adds codex integration manifest.
.specify/integration.json Switches default integration to codex and updates schema.
.specify/init-options.json Switches init defaults to codex and updates Spec Kit version.
.specify/extensions/git/scripts/powershell/initialize-repo.ps1 Adds Git extension script for initializing a repo (PowerShell).
.specify/extensions/git/scripts/powershell/git-common.ps1 Adds Git extension shared functions (PowerShell).
.specify/extensions/git/scripts/bash/initialize-repo.sh Adds Git extension script for initializing a repo (bash).
.specify/extensions/git/scripts/bash/git-common.sh Adds Git extension shared functions (bash).
.specify/extensions/git/README.md Documents the new Git branching workflow extension.
.specify/extensions/git/git-config.yml Adds Git extension configuration file.
.specify/extensions/git/extension.yml Adds extension manifest defining commands/hooks.
.specify/extensions/git/config-template.yml Adds template for Git extension configuration.
.specify/extensions/git/commands/speckit.git.validate.md Adds validate command documentation for Git extension.
.specify/extensions/git/commands/speckit.git.remote.md Adds remote detection command documentation for Git extension.
.specify/extensions/git/commands/speckit.git.initialize.md Adds initialize command documentation for Git extension.
.specify/extensions/git/commands/speckit.git.feature.md Adds feature-branch creation command documentation for Git extension.
.specify/extensions/git/commands/speckit.git.commit.md Adds auto-commit command documentation for Git extension.
.specify/extensions/.registry Registers the git extension (enabled) and its commands per integration.
.specify/extensions.yml Enables auto-executed hooks for the git extension across workflow steps.
.github/prompts/speckit.git.validate.prompt.md Adds Git extension agent prompt stub.
.github/prompts/speckit.git.remote.prompt.md Adds Git extension agent prompt stub.
.github/prompts/speckit.git.initialize.prompt.md Adds Git extension agent prompt stub.
.github/prompts/speckit.git.feature.prompt.md Adds Git extension agent prompt stub.
.github/prompts/speckit.git.commit.prompt.md Adds Git extension agent prompt stub.
.github/agents/speckit.git.validate.agent.md Adds Git extension agent definition.
.github/agents/speckit.git.remote.agent.md Adds Git extension agent definition.
.github/agents/speckit.git.initialize.agent.md Adds Git extension agent definition.
.github/agents/speckit.git.feature.agent.md Adds Git extension agent definition.
.github/agents/speckit.git.commit.agent.md Adds Git extension agent definition.
.claude/skills/speckit-git-validate/SKILL.md Adds Claude skill doc for git validate.
.claude/skills/speckit-git-remote/SKILL.md Adds Claude skill doc for git remote.
.claude/skills/speckit-git-initialize/SKILL.md Adds Claude skill doc for git initialize.
.claude/skills/speckit-git-feature/SKILL.md Adds Claude skill doc for git feature.
.claude/skills/speckit-git-commit/SKILL.md Adds Claude skill doc for git commit.
.agents/skills/speckit-taskstoissues/SKILL.md Updates skill metadata formatting and adds extension hook checks.
.agents/skills/speckit-tasks/SKILL.md Updates skill metadata formatting and switches to new setup script + template resolution.
.agents/skills/speckit-plan/SKILL.md Updates skill metadata formatting and agent-context update instructions.
.agents/skills/speckit-implement/SKILL.md Updates skill metadata formatting and command references.
.agents/skills/speckit-git-validate/SKILL.md Adds agent skill doc for git validate.
.agents/skills/speckit-git-remote/SKILL.md Adds agent skill doc for git remote.
.agents/skills/speckit-git-initialize/SKILL.md Adds agent skill doc for git initialize.
.agents/skills/speckit-git-feature/SKILL.md Adds agent skill doc for git feature.
.agents/skills/speckit-git-commit/SKILL.md Adds agent skill doc for git commit.
.agents/skills/speckit-constitution/SKILL.md Updates skill metadata formatting and adds extension hook checks.
.agents/skills/speckit-checklist/SKILL.md Updates skill metadata formatting, command references, and adds extension hook checks.
.agents/skills/speckit-analyze/SKILL.md Updates skill metadata formatting, command references, and adds extension hook checks.

Comment on lines +8 to +14
[Authorize]
public class StructuredLogsHub(StructuredLogSubscriptionManager subscriptionManager) : Hub<IStructuredLogsClient>
{
public async Task SubscribeAsync(StructuredLogFilter? filter)
{
await subscriptionManager.SubscribeAsync(Context.ConnectionId, ValidateFilter(filter), Context.ConnectionAborted);
}
Comment on lines +56 to +60
Properties = properties
};

var redacted = redactor.Redact(logEvent);
_ = logProvider.PublishAsync(redacted);
Comment on lines +118 to +124
QueueDroppedSummaryIfNeeded();
return;
}

Channel.Writer.TryWrite(StructuredLogStreamItem.FromLogEvent(logEvent));
_pendingItemCount++;
}
Comment on lines +29 to +34
- `Id`: stable source identifier for the running process.
- `Name`: display name.
- `MachineName`, `ProcessId`, `ProcessName`: process metadata.
- `PodName`, `Namespace`, `ContainerName`, `NodeName`: Kubernetes/container metadata when available.
- `StartedAt`, `LastSeen`: source lifecycle timestamps.
- `Status`: unknown, healthy, stale, or disconnected.
Comment on lines +40 to +48
- `MinimumLevel`: inclusive minimum level.
- `Levels`: exact level set.
- `CategoryPrefix`: category prefix filter.
- `Query`: free-text filter across message, template, category, exception, scopes, and properties.
- `TenantId`, `WorkflowDefinitionId`, `WorkflowInstanceId`: workflow context filters.
- `TraceId`, `SpanId`, `CorrelationId`: correlation filters.
- `SourceId`: source filter.
- `From`, `To`: timestamp range.
- `Limit`: recent query limit clamped by options.
Comment on lines +41 to +44
}
],
"droppedCount": 0
}
Comment on lines +55 to +60
{
"id": "local",
"name": "elsa-server",
"machineName": "dev-machine",
"processId": 12345,
"processName": "Elsa.Server.Web",
Comment on lines +65 to +68
"startedAt": "2026-05-10T11:59:00Z",
"lastSeen": "2026-05-10T12:00:00Z",
"status": "Healthy"
}
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