-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[10.x] Add processors to logging (placeholders) #46344
Conversation
ab9281a
to
de64d99
Compare
To preserve previous behaviour |
de64d99
to
d8ed0d3
Compare
Sure but if it's
I'm not sure it's really a breaking change, since the |
The behavior change would be that, currently, you get the following written to the log:
whereas with the placeholders interpolated, you'd get this:
The degree to which that's a breaking change is not my call to make. I will note, though, that whether you want the placeholders interpolated is going to vary by the handler. For writing to syslog, probably yes. For writing to a DB, almost certainly no. For writing to a remote logging service, maybe, depending on if the service supports placeholders. So the default should probably vary by the handler used. |
The default can be Then apps using 10.x can opt in, and apps that don't want to use this can opt out in 11.x |
It could, sure (and I can do it), but it's worth the (very small) risk to do it now in my opinion. |
It's less breaking to default to |
The |
Maybe this PR should target
11.x
.This PR adds the possibility to use Monolog processors and adds a default
PsrLogMessageProcessor
to all drivers.Following @Crell's post, the logger should be able to use placeholders by default:
It's not the case today so I added it in this PR.
It can be disabled with
with_placeholders
:This PR also adds the possibility to configure processors for the
monolog
driver: