params = $params; } /** * @param string $message * @param string|null $fileName * * @return void * @throws InternalServerErrorMaestroException */ public function setLog(string $message, string $fileName = null): void { if (null === $fileName ) { if ($this->params->get('generation_log_enabled') && $this->params->get('generation_log_file_name')) { $fileName = $this->params->get('generation_log_file_name'); } else { throw new InternalServerErrorMaestroException('No default generation log file name found !'); } } $basePath = $this->params->get('arborescence_generation_log'); $dt = new \DateTime(); $filesystem = new Filesystem(); $filesystem->appendToFile($basePath . $fileName, $dt->format('Y-m-d H:i:s:v') . " - " . $message . "\n"); } }