We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 406a2b4 commit 5e80471Copy full SHA for 5e80471
src/Logging/EventLogger.php
@@ -40,10 +40,16 @@ public function trace(Event $event): void
40
$indentation = PHP_EOL . str_repeat(' ', strlen($telemetryInfo));
41
$lines = preg_split('/\r\n|\r|\n/', $event->asString());
42
43
+ $flags = FILE_APPEND;
44
+
45
+ if (PHP_OS_FAMILY !== 'Windows' || $this->path !== 'php://stdout') {
46
+ $flags |= LOCK_EX;
47
+ }
48
49
file_put_contents(
50
$this->path,
51
$telemetryInfo . implode($indentation, $lines) . PHP_EOL,
- FILE_APPEND | LOCK_EX,
52
+ $flags,
53
);
54
}
55
0 commit comments