Skip to content

Commit fe26133

Browse files
committed
Fix file logging handler to not fail on the first write after file-creation (#1877)
1 parent dd48fb8 commit fe26133

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/SimpleSAML/Logger/FileLoggingHandler.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,8 @@ public function __construct(Configuration $config)
8989
sprintf("Could not write to logfile: %s", $this->logFile),
9090
);
9191
}
92-
} elseif (!$this->fileSystem->touch($this->logFile)) {
93-
throw new CannotWriteFileException(sprintf(
94-
"The logging directory is not writable for the web server user. Could not create logfile: %s",
95-
$this->logFile,
96-
));
92+
} else {
93+
$this->fileSystem->touch($this->logFile);
9794
}
9895

9996
$timeUtils = new Utils\Time();

0 commit comments

Comments
 (0)