BrianSandberg.ElastiLog 1.2.23

ElastiLog

Lightweight package for logging to Elasticsearch / OpenSearch.

Includes ASP.NET middleware for automatically capturing request and response data.

Options (AddElastiLog(options => ...))

  • OnPrerequest / OnPostrequest - synchronous hooks run right before/after the request pipeline.
  • OnPrerequestAsync - awaited right after OnPrerequest, before the request is passed down the pipeline. Use for enrichment that needs async work (e.g. peeking at a buffered request body) that a synchronous hook can't do.
  • EnableStartLogging (default false) - when true, sends a thin phase: "start" document immediately (after OnPrerequest/OnPrerequestAsync), keyed by the request's trace identifier as an explicit document id, then overwrites that same document in place with the full phase: "completed" data at request end - instead of two separate, hard-to-correlate documents. A request that never completes leaves a permanent, directly queryable "still starting" document behind. Requires a native Elasticsearch/OpenSearch _doc endpoint (the explicit-id write always PUTs to {index}/_doc/{id}, bypassing the configured Path template and any {token} substitution it does for the normal, auto-id case) - not compatible with a token-routed logging endpoint.

Scopes

logger.BeginScope("description") starts a nested unit of work that is sent as its own document, sharing the parent's correlation and any other ElastiLog.PromotedFields. Each scope document gets its own time (the scope's start time) so it shows up in OpenSearch Dashboards/Kibana index patterns that use time as the time field. Its duration excludes nested scopes, while durationTotal includes them.

No packages depend on BrianSandberg.ElastiLog.

.NET 8.0

  • No dependencies.

.NET 10.0

  • No dependencies.

Version Downloads Last updated
1.2.23 1 09/28/2026
1.2.22 10 09/25/2026
1.2.21 39 09/18/2026
1.2.20 46 09/12/2026
1.2.19 44 09/09/2026
1.2.18 285 05/02/2026
1.2.17 250 05/02/2026
1.2.16 399 01/23/2026
1.1.15 345 01/05/2026
1.1.14 316 01/05/2026
1.1.13 364 11/12/2025
1.1.11 417 10/03/2025
1.1.10 1,608 09/08/2024
1.1.9 672 09/07/2024
1.1.8 578 09/05/2024
1.1.7 504 09/04/2024
1.1.6 526 09/03/2024
1.1.5 644 11/18/2023
1.1.3 618 09/15/2023
1.1.2 576 09/15/2023
1.0.10 809 04/08/2022
1.0.9 703 04/08/2022
1.0.8 717 04/02/2022
0.1.1-pre 784 04/02/2022
0.1.0-pre 701 04/02/2022