* Alle Rechte vorbehalten. */ namespace App\Service\Docker\Logger; use Symfony\Component\Filesystem\Filesystem; class LoggerService { const string LOG_FILE = 'docker.log'; public function __construct( protected string $logDir, ){} public function log(string $message): void { new Filesystem()->appendToFile($this->logDir . DIRECTORY_SEPARATOR . self::LOG_FILE, $message . PHP_EOL); } public function clearLog(): void { new Filesystem()->remove($this->logDir . DIRECTORY_SEPARATOR . self::LOG_FILE); } public function getLog(): string { return new Filesystem()->readFile($this->logDir . DIRECTORY_SEPARATOR . self::LOG_FILE); } }