src/Logger/Handler/FileHandler.php
<?php
declare(strict_types=1);
/* (c) Anton Medvedev <anton@medv.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Deployer\Logger\Handler;
class FileHandler implements HandlerInterface
{
/**
* @var string
*/
private $filePath;
public function __construct(string $filePath)
{
$this->filePath = $filePath;
}
public function log(string $message): void
{
file_put_contents($this->filePath, $message, FILE_APPEND);
}
}