Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking Changes
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().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.