elsa-core/specs/003-live-server-logs/quickstart.md
Sipke Schoorstra ab3e46bbe2
[codex] Add live server log streaming diagnostics (#7438)
* Add live server logs Spec Kit plan

* Implement live server logs diagnostics module

* Add server log sources and redaction hardening

* Add diagnostics unit tests

* Harden server log hub subscriptions

* Secure server log hub permissions

* Validate server log filter updates

* Add diagnostics logger and source tests

* Add diagnostics integration test project

* Add multi-source diagnostics provider coverage

* Broadcast server log source changes

* Document diagnostics server log streaming

* Add diagnostics sample host wiring

* Record diagnostics validation results

* Address server log PR feedback

* Rename diagnostics module to server logs

* Add server logs shell feature

* Make server logs shell options bindable

* Accept read wildcard for server logs

* Align server logs authorization with API patterns

* Update CShells structure and logging levels, add diagnostics module

* Rename PostgreSql shell feature classes for consistency

* Switch from Sqlite to PostgreSQL for workflow and identity persistence, add QuartzPostgreSql configuration

* Refactor server logs into diagnostics structured logs (#7440)

* 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.
2026-05-11 00:08:52 +02:00

1.8 KiB

Quickstart: Live Server Log Streaming

Enable the feature

services.AddElsa(elsa =>
{
    elsa.UseServerLogStreaming(options =>
    {
        options.RecentLogCapacity = 5_000;
        options.MaxRecentLogQuerySize = 1_000;
        options.SourceHeartbeatTimeout = TimeSpan.FromSeconds(30);
    });
});

Map the hub

app.UseServerLogStreaming();

This maps /elsa/hubs/server-logs and any REST endpoints under the configured Elsa API prefix.

Authorize users

Grant operational users the read:server-logs permission.

Validate locally

  1. Start Elsa Server with the feature enabled.
  2. Open Elsa Studio with the paired Studio module installed.
  3. Emit an ILogger message from the server.
  4. Verify it appears in Studio's Server Logs page.
  5. Change the level filter to Warning and verify lower-level logs are hidden.

Validation Notes

  • dotnet test test/unit/Elsa.ServerLogs.UnitTests/Elsa.ServerLogs.UnitTests.csproj --no-restore passes with 22 server logs tests.
  • dotnet build src/modules/Elsa.ServerLogs/Elsa.ServerLogs.csproj --no-restore passes.
  • dotnet restore src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj passes.
  • dotnet build src/apps/Elsa.Server.Web/Elsa.Server.Web.csproj --no-restore passes.
  • dotnet test test/integration/Elsa.ServerLogs.IntegrationTests/Elsa.ServerLogs.IntegrationTests.csproj --no-restore passes with 4 server logs smoke tests.
  • The commands currently report existing repository warnings, including NU1903 for Snappier and nullable/analyzer warnings in unrelated modules.

Clustered deployments

The in-memory provider shows logs for the current process only. For merged multi-pod logs, configure a future shared provider that implements IServerLogProvider; Studio continues to use the same API and hub contracts.