1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

FileLogger: fixed object to string conversion with custom driver (#376) (#376)

Co-authored-by: Miloslav Hůla <miloslav.hula@fsv.cvut.cz>
This commit is contained in:
Miloslav Hůla
2020-10-08 14:19:22 +02:00
committed by David Grudl
parent 7b02296f3e
commit f5fa2255ff

View File

@@ -73,8 +73,9 @@ class FileLogger
private function writeToFile(Dibi\Event $event, string $message): void
{
$driver = $event->connection->getConfig('driver');
$message .=
"\n-- driver: " . $event->connection->getConfig('driver') . '/' . $event->connection->getConfig('name')
"\n-- driver: " . (is_object($driver) ? get_class($driver) : $driver) . '/' . $event->connection->getConfig('name')
. "\n-- " . date('Y-m-d H:i:s')
. "\n\n";
file_put_contents($this->file, $message, FILE_APPEND | LOCK_EX);