Skip to content

Commit

Permalink
Fixed Logger::$log_path property behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
Isidro A. López G committed Sep 21, 2020
1 parent 457baf3 commit 016e71e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Services/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ protected function initialize(array $params) {
// set log path where logs will be recorded
if (!isset($params['log_path'])) {
$this->enabled = false;
$this->log_path = '';
} else {
$this->log_path = trim($params['log_path'], '/\\') . DIRECTORY_SEPARATOR;
}
// set log path
$this->log_path = trim($params['log_path'], '/\\') . DIRECTORY_SEPARATOR;
// if path does not exists
if (!is_dir($this->log_path) && is_writable($this->log_path)) {
mkdir($this->log_path, 0755, true);
Expand Down

0 comments on commit 016e71e

Please sign in to comment.