Enhance logging

This commit is contained in:
Yonas Habteab 2023-09-15 15:01:41 +02:00 committed by Johannes Meyer
parent 47b214ee1b
commit 167ff54947

View File

@ -213,10 +213,14 @@ abstract class DbMigrationHook implements Countable
$this->version = $migration->getVersion(); $this->version = $migration->getVersion();
unset($this->migrations[$migration->getVersion()]); unset($this->migrations[$migration->getVersion()]);
Logger::info( $data = [
"Applied %s pending migration version %s successfully", 'name' => $this->getName(),
$this->getName(), 'version' => $migration->getVersion()
$migration->getVersion() ];
AuditHook::logActivity(
'migrations',
'Migrated database schema of {{name}} to version {{version}}',
$data
); );
$this->storeState($migration->getVersion(), null); $this->storeState($migration->getVersion(), null);
@ -225,7 +229,7 @@ abstract class DbMigrationHook implements Countable
"Failed to apply %s pending migration version %s \n%s", "Failed to apply %s pending migration version %s \n%s",
$this->getName(), $this->getName(),
$migration->getVersion(), $migration->getVersion(),
$e->getMessage() $e
); );
Logger::debug($e->getTraceAsString()); Logger::debug($e->getTraceAsString());