Skip to content

Conversation

@ryanrath
Copy link
Contributor

@ryanrath ryanrath commented Sep 18, 2025

NOTE: I'll be closing this PR as soon as #2086 is merged as this PR has all sorts of commits from previous versions of a couple of past PRs so that I could test things out. I have a new branch that is strictly the Symfony Changes that

Description

Motivation and Context

Tests performed

Checklist:

  • The pull request description is suitable for a Changelog entry
  • The milestone is set correctly on the pull request
  • The appropriate labels have been added to the pull request

As of PHP 8.2 dynamically creating properties has been deprecated (
https://php.watch/versions/8.2/dynamic-properties-deprecated ). As the changes
to support this are compatible with PHP 7.4 this PR can be merged prior to the
main 7.4 -> 8.2 upgrade.
In newer versions of Monolog the shortened versions of the error and critical
log methods have been removed so I've updated those usages to the currently
supported full name versions
These updates are to prepare for the PHP 8.2 updates / Symfony Migration as the
new version of Monolog we're updating to no longer allows us to provide arrays
as messages. Thankfully the new version of Monolog does allow for classes that
implement `\Stringable` to be provided as a message. To take advantage of this I
created a new class called `LogOutput` that implements `\Stringable` and takes /
provides as a public member variable an array. This array is used when
`__toString()` is called and outputs information as we expect when logging to
the console. When logging to the database we instead expect to output
json_encoded data. To accomplish this I've added a new "Processor" ( right now
this is just an anonymous function, in the Symfony Migration they have a class
for these ) to the `CCRDBHandler` that will "enrich" the record being logged by
setting a new property called 'formatted' (for the new version of Monolog)
prior to CCRDBHandler writing the record to the db.

The changes were originally included in the Symfony Migration PR
but they don't actually require Symfony to function and will make the Symfony
PR smaller.
These updates are to prepare for the PHP 8.2 updates / Symfony Migration as the
new version of Monolog we're updating to no longer allows us to provide arrays
as messages. Thankfully the new version of Monolog does allow for classes that
implement `\Stringable` to be provided as a message. To take advantage of this I
created a new class called `LogOutput` that implements `\Stringable` and takes /
provides as a public member variable an array. This array is used when
`__toString()` is called and outputs information as we expect when logging to
the console. When logging to the database we instead expect to output
json_encoded data. To accomplish this I've added a new "Processor" ( right now
this is just an anonymous function, in the Symfony Migration they have a class
for these ) to the `CCRDBHandler` that will "enrich" the record being logged by
setting a new property called 'formatted' (for the new version of Monolog)
prior to CCRDBHandler writing the record to the db.

The changes were originally included in the Symfony Migration PR
but they don't actually require Symfony to function and will make the Symfony
PR smaller.
@ryanrath ryanrath mentioned this pull request Sep 24, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant