Skip to content

Commit

Permalink
Working on file append issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
levidurfee committed Nov 26, 2016
1 parent 9a26fbe commit 87d1709
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ public function log($level, $message, array $context = [])
// Create a new LogFormat instance to format the log entry.
$message = LogFormat::create($level, $message, $context);

// Get the contents of the file before writing to it. This is so it can be appended.
$contents = $this->filesystem->read($filename);

$contents .= $message;

// Write the log message from the Log Format instance to the Log Format file name instance.
$this->filesystem->put($filename, $message."\n");
$this->filesystem->put($filename, $contents."\n");
}
}

Expand Down

0 comments on commit 87d1709

Please sign in to comment.