Releases: aubes/ecs-logging-bundle
Releases · aubes/ecs-logging-bundle
v3.1.0
Added
CorrelationIdProcessor— new processor that reads a correlation ID from Monologextraand writes it tolabels.correlation_idortrace.id. Works with any library that populatesextra(e.g.aubes/correlation-bundle). The source key is removed fromextraafter processing.TracingProcessor— newopentelemetrymode that reads flattrace_id/span_id/trace_flagskeys injected by the OpenTelemetry Monolog processor and maps them to ECS fields. The flat keys are cleaned up from context automatically.
v3.0.1
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
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.ecsnow produces a different JSON structure:log.levelis nested underlogand lowercased (was a root-level dot-notation key). Existing Elasticsearch index mappings may need to be updated.AutoLabelProcessor::FIELDS_ALLcontent has changed:os,vlan,interface, andtracinghave been removed;entity(ECS 9.x) andgen_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 tolabels. Addmove_to_labels: trueto restore the previous behaviour.AutoLabelProcessor— thefieldsconfig key is replaced bymode(bundle|full|custom). Usemode: customwithfields: [...]for the previous behaviour of passing a raw list.AutoLabelProcessor::FIELDS_MINIMALconstant removed. Usemode: bundleinstead.AbstractProcessor—getTargetField()andsupport()visibility changed frompublictoprotected. Code calling these methods from outside a subclass will fail.AbstractProcessor—getTargetField()is nowfinaland no longer abstract. Subclasses must pass the target field name as the second argument toparent::__construct()instead of implementinggetTargetField().- A misconfigured processor (enabled but no channel or handler defined) now throws an
InvalidConfigurationExceptionat container compile time. Previously it silently had no effect. EcsUserProvider—getUserIdentifier()is now mapped touser.nameinstead ofuser.id. Symfony's identifier is a login or email (user.name), not a technical database ID (user.id). If you rely onuser.idin your index mappings, implement a customEcsUserProviderInterface.tagsconfig option — static tags added to every log record via the ECStagsfield (e.g.['env:prod', 'region:eu-west-1']). Passed through to the underlyingElasticCommonSchemaFormatter.
Added
ecs_versionconfig option — declare which ECS version to output (default9.3.0). Override for older Elastic Stack deployments (e.g.8.11.0). Invalid values throw anInvalidConfigurationExceptionat boot.HttpRequestProcessor— injects ECShttp.*andurl.*fields from the current HTTP request. Optionalinclude_full_url(disabled by default — may expose sensitive query parameters),include_client_ip(disabled by default), andinclude_referrer(disabled by default — Referer header may carry sensitive external URLs).HostProcessor— injects ECShost.*fields (host.name,host.ip,host.architecture) resolved at boot time. Optionalresolve_ip(defaultfalse) to auto-detecthost.ipvia DNS.ErrorProcessor— newmap_exception_keyoption to automatically process Symfony'scontext['exception']as ECSerror.*.AutoLabelProcessor— newmodeoption (bundle|full|custom, defaultbundle) replacing the rawfieldslist.bundlewhitelists fields used by this bundle's processors;fullcovers all ECS field sets;customuses the explicitfieldslist.AutoLabelProcessor— newmove_to_labelsoption (defaultfalse). Non-ECS fields are now dropped by default; setmove_to_labels: trueto preserve them underlabelsas before.AutoLabelProcessor— newinclude_extraoption to also process non-ECS keys from Monolog'sextraarray.AutoLabelProcessor— newnon_scalar_strategyoption (skip|json, defaultskip). Non-scalar context values are either dropped (skip) or JSON-encoded intolabels(json) whenmove_to_labelsis enabled.TracingProcessor— newspan_idinput key. When present in the tracing array, injects ECSspan.idinto the log record.processor.user.provider— the referenced service is now validated at container compile time: it must implementEcsUserProviderInterface. Invalid configurations throw at boot instead of silently failing at log time.EcsUserProviderandUserProcessor— both implementResetInterfacefor compatibility with FrankenPHP worker mode. State is cleared between requests automatically.
Fixed
AutoLabelProcessor— non-scalar values in non-ECS context fields were previously placed inlabelsas-is, violating ECS (labels must be scalar). They are now handled vianon_scalar_strategy.AutoLabelProcessor— a non-arraycontext['labels']value no longer throws\InvalidArgumentExceptionat runtime. The invalid value is silently overwritten to preserve ECS compliance.
v2.0.2
v2.0.1
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