You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP 8.2 Migration Prep: Logging Changes to support latest version of Monolog (#2086)
* Logging Updates to prepare for PHP 8.2
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.
---------
Co-authored-by: Joe White <[email protected]>
$log->err("Unable to connect to the database, please check the following: \n\t - settings for 'database' in portal_settings.ini are correct.\n\t - the database identified by the 'database' section of portal_settings.ini is running, accepting connections, and that the user specified has connection privileges.");
249
+
$log->error("Unable to connect to the database, please check the following: \n\t - settings for 'database' in portal_settings.ini are correct.\n\t - the database identified by the 'database' section of portal_settings.ini is running, accepting connections, and that the user specified has connection privileges.");
250
250
exit(1);
251
251
}
252
252
$log->debug("*** Database Verification Passed!");
@@ -519,7 +519,7 @@ function processResult(iDatabase $db, $module, $moduleData, $modules)
519
519
}
520
520
521
521
if ($modules === null) {
522
-
$log->err("Unable to process $module, missing module information. Is there a $module.json file in CONF_DIR/datawarehouse.d?");
522
+
$log->error("Unable to process $module, missing module information. Is there a $module.json file in CONF_DIR/datawarehouse.d?");
523
523
return;
524
524
}
525
525
@@ -758,7 +758,7 @@ SQL;
758
758
if ($updated === 1) {
759
759
$log->info("[SUCCESS] Associated Module and Module Version.");
760
760
} else {
761
-
$log->err("[FAILURE] Unable to associate Module and Module Version.");
761
+
$log->error("[FAILURE] Unable to associate Module and Module Version.");
0 commit comments