Skip to content

Commit

Permalink
FileLogger: fixed object to string conversion with custom driver (#376)…
Browse files Browse the repository at this point in the history
… (#376)

Co-authored-by: Miloslav Hůla <miloslav.hula@fsv.cvut.cz>
  • Loading branch information
2 people authored and dg committed Oct 8, 2020
1 parent cc37121 commit 2a2de03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Dibi/Loggers/FileLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ public function logEvent(Dibi\Event $event): void

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);
Expand Down

0 comments on commit 2a2de03

Please sign in to comment.