Skip to content

Releases: aubes/ecs-logging-bundle

v3.1.0

16 Apr 00:12
9ce1edd

Choose a tag to compare

Added

  • CorrelationIdProcessor — new processor that reads a correlation ID from Monolog extra and writes it to labels.correlation_id or trace.id. Works with any library that populates extra (e.g. aubes/correlation-bundle). The source key is removed from extra after processing.
  • TracingProcessor — new opentelemetry mode that reads flat trace_id/span_id/trace_flags keys injected by the OpenTelemetry Monolog processor and maps them to ECS fields. The flat keys are cleaned up from context automatically.

v3.0.1

27 Mar 08:17
802ace4

Choose a tag to compare

Fixed

  • Per-processor channels/handlers routing no longer inherits global defaults when the processor defines its own routing. Previously, a processor with only handlers configured would also inherit global channels, causing an "cannot target both channels and handlers" error.

v3.0.0

25 Mar 16:00
2633783

Choose a tag to compare

Breaking Changes

  • PHP 8.2 minimum — PHP 8.1 (EOL since December 2024) is no longer supported.
  • Symfony LTS-only — supported versions are 6.4 (LTS), 7.4 (LTS), and 8.0. Intermediate versions (7.0–7.3) are not supported.
  • monolog.formatter.ecs now produces a different JSON structure: log.level is nested under log and lowercased (was a root-level dot-notation key). Existing Elasticsearch index mappings may need to be updated.
  • AutoLabelProcessor::FIELDS_ALL content has changed: os, vlan, interface, and tracing have been removed; entity (ECS 9.x) and gen_ai (ECS 9.1) have been added. If you reference this constant directly in code, review your usage.
  • AutoLabelProcessor — non-ECS fields are now dropped by default instead of being moved to labels. Add move_to_labels: true to restore the previous behaviour.
  • AutoLabelProcessor — the fields config key is replaced by mode (bundle | full | custom). Use mode: custom with fields: [...] for the previous behaviour of passing a raw list.
  • AutoLabelProcessor::FIELDS_MINIMAL constant removed. Use mode: bundle instead.
  • AbstractProcessorgetTargetField() and support() visibility changed from public to protected. Code calling these methods from outside a subclass will fail.
  • AbstractProcessorgetTargetField() is now final and no longer abstract. Subclasses must pass the target field name as the second argument to parent::__construct() instead of implementing getTargetField().
  • A misconfigured processor (enabled but no channel or handler defined) now throws an InvalidConfigurationException at container compile time. Previously it silently had no effect.
  • EcsUserProvidergetUserIdentifier() is now mapped to user.name instead of user.id. Symfony's identifier is a login or email (user.name), not a technical database ID (user.id). If you rely on user.id in your index mappings, implement a custom EcsUserProviderInterface.
  • tags config option — static tags added to every log record via the ECS tags field (e.g. ['env:prod', 'region:eu-west-1']). Passed through to the underlying ElasticCommonSchemaFormatter.

Added

  • ecs_version config option — declare which ECS version to output (default 9.3.0). Override for older Elastic Stack deployments (e.g. 8.11.0). Invalid values throw an InvalidConfigurationException at boot.
  • HttpRequestProcessor — injects ECS http.* and url.* fields from the current HTTP request. Optional include_full_url (disabled by default — may expose sensitive query parameters), include_client_ip (disabled by default), and include_referrer (disabled by default — Referer header may carry sensitive external URLs).
  • HostProcessor — injects ECS host.* fields (host.name, host.ip, host.architecture) resolved at boot time. Optional resolve_ip (default false) to auto-detect host.ip via DNS.
  • ErrorProcessor — new map_exception_key option to automatically process Symfony's context['exception'] as ECS error.*.
  • AutoLabelProcessor — new mode option (bundle | full | custom, default bundle) replacing the raw fields list. bundle whitelists fields used by this bundle's processors; full covers all ECS field sets; custom uses the explicit fields list.
  • AutoLabelProcessor — new move_to_labels option (default false). Non-ECS fields are now dropped by default; set move_to_labels: true to preserve them under labels as before.
  • AutoLabelProcessor — new include_extra option to also process non-ECS keys from Monolog's extra array.
  • AutoLabelProcessor — new non_scalar_strategy option (skip | json, default skip). Non-scalar context values are either dropped (skip) or JSON-encoded into labels (json) when move_to_labels is enabled.
  • TracingProcessor — new span_id input key. When present in the tracing array, injects ECS span.id into the log record.
  • processor.user.provider — the referenced service is now validated at container compile time: it must implement EcsUserProviderInterface. Invalid configurations throw at boot instead of silently failing at log time.
  • EcsUserProvider and UserProcessor — both implement ResetInterface for compatibility with FrankenPHP worker mode. State is cleared between requests automatically.

Fixed

  • AutoLabelProcessor — non-scalar values in non-ECS context fields were previously placed in labels as-is, violating ECS (labels must be scalar). They are now handled via non_scalar_strategy.
  • AutoLabelProcessor — a non-array context['labels'] value no longer throws \InvalidArgumentException at runtime. The invalid value is silently overwritten to preserve ECS compliance.

v2.0.2

18 Mar 12:58
56b7b58

Choose a tag to compare

  • fix: ensure AutoLabelProcessor runs last and validate labels type
  • Fix: Monolog configuration error

v2.0.1

10 Mar 22:12
0749e94

Choose a tag to compare

Symfony 8 compatibility

Changes

Symfony 7 and 8 compatibility

  • Replace Symfony\Component\Security\Core\Security (removed in Symfony 7) with TokenStorageInterface in EcsUserProvider
  • Update composer.json constraints to include ^8.0

Bug fixes

  • Fix operator precedence bug in EcsLoggingExtension : custom user providers were never used
  • Fix missing address field in Configuration for the service processor

v2.0.0

04 Mar 20:00
6043ae3

Choose a tag to compare

Add Symfony 7 and Monolog 3 compatibility