for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Faulancer\Log\Writer;
/**
* Class DefaultWriter | DefaultWriter.php
*
* @package Faulancer\Log
* @author Florian Knapp <[email protected]>
*/
class DefaultWriter extends AbstractWriter
{
* Write default log format
* @inheritdoc
* @return int|bool
public function write(string $logfile, string $message, string $level)
$columns = [
(new \DateTime())->format('d.m.Y H:i:s'),
strtoupper($level),
$message
];
$messageString = implode(' | ', $columns) . "\r\n";
return file_put_contents($logfile, $messageString, FILE_APPEND);
}