[codex] Add live server log streaming diagnostics#7438
Conversation
|
| 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
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- 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
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 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.
|
Paired Studio PR: elsa-workflows/elsa-studio#810 |
Greptile SummaryThis PR introduces
Confidence Score: 4/5Safe 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
|
| 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
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
|
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. |
…e, add QuartzPostgreSql configuration
* 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.
There was a problem hiding this comment.
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.StructuredLogsmodule (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. |
| [Authorize] | ||
| public class StructuredLogsHub(StructuredLogSubscriptionManager subscriptionManager) : Hub<IStructuredLogsClient> | ||
| { | ||
| public async Task SubscribeAsync(StructuredLogFilter? filter) | ||
| { | ||
| await subscriptionManager.SubscribeAsync(Context.ConnectionId, ValidateFilter(filter), Context.ConnectionAborted); | ||
| } |
| Properties = properties | ||
| }; | ||
|
|
||
| var redacted = redactor.Redact(logEvent); | ||
| _ = logProvider.PublishAsync(redacted); |
| QueueDroppedSummaryIfNeeded(); | ||
| return; | ||
| } | ||
|
|
||
| Channel.Writer.TryWrite(StructuredLogStreamItem.FromLogEvent(logEvent)); | ||
| _pendingItemCount++; | ||
| } |
| - `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. |
| - `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. |
| } | ||
| ], | ||
| "droppedCount": 0 | ||
| } |
| { | ||
| "id": "local", | ||
| "name": "elsa-server", | ||
| "machineName": "dev-machine", | ||
| "processId": 12345, | ||
| "processName": "Elsa.Server.Web", |
| "startedAt": "2026-05-10T11:59:00Z", | ||
| "lastSeen": "2026-05-10T12:00:00Z", | ||
| "status": "Healthy" | ||
| } |
Summary
Adds an
Elsa.Diagnosticsmodule for live backend server log streaming. The module capturesILoggerevents, redacts sensitive values, stores a bounded recent-log buffer, exposes recent-log and source endpoints, and streams live events over SignalR for Studio.Highlights
useServerLogStreamingflag.Validation
dotnet test test/unit/Elsa.Diagnostics.UnitTests/Elsa.Diagnostics.UnitTests.csproj --no-restorepassed, 20 tests.dotnet build src/modules/Elsa.Diagnostics/Elsa.Diagnostics.csproj --no-restorepassed.dotnet restore src/apps/Elsa.Server.Web/Elsa.Server.Web.csprojpassed.dotnet build src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj --no-restorepassed.dotnet test test/integration/Elsa.Diagnostics.IntegrationTests/Elsa.Diagnostics.IntegrationTests.csproj --no-restoreexited successfully, but the integration project currently has no discoverable tests.Existing repository warnings remain, including
NU1903forSnappierand nullable/analyzer warnings in unrelated modules.