We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 72d37d4 + 6b4a598 commit 4af1608Copy full SHA for 4af1608
Wa72/SimpleLogger/FileLogger.php
@@ -2,7 +2,7 @@
2
/**
3
* This class is a simple file logger implementing \Psr\Log\LoggerInterface (PSR-3)
4
*
5
- *
+ *
6
* @author Christoph Singer
7
* @license MIT
8
*/
@@ -27,12 +27,12 @@ public function __construct($logfile)
27
public function log($level, $message, array $context = array())
28
{
29
$logline = '[' . date('Y-m-d H:i:s') . '] ' . strtoupper($level) . ': ' . $this->interpolate($message, $context) . "\n";
30
- file_put_contents($this->logfile, $logline, FILE_APPEND);
+ file_put_contents($this->logfile, $logline, FILE_APPEND | LOCK_EX);
31
}
32
33
34
* Interpolates context values into the message placeholders.
35
36
* This function is just copied from the example in the PSR-3 spec
37
38
0 commit comments