Fix locking

This commit is contained in:
Dennis Eichhorn 2016-12-03 21:54:32 +01:00
parent 7b36dafa57
commit 7bd0bc7067

View File

@ -311,8 +311,10 @@ class FileLogger implements LoggerInterface
$this->createFile();
$this->fp = fopen($this->path, 'a');
if ($this->fp !== false) {
if (flock($this->fp, LOCK_EX) && $this->fp !== false) {
fwrite($this->fp, $message . "\n");
fflush($this->fp);
flock($this->fp, LOCK_UN);
fclose($this->fp);
$this->fp = false;
}