Merged in release/3.3 (pull request #6651)

HOR-4907

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2018-10-12 13:44:26 +00:00
committed by Julio Cesar Laura Avendaño
2 changed files with 12 additions and 8 deletions

View File

@@ -77,10 +77,6 @@ class MonologProvider
*/
public function __construct($channel, $fileLog, $readLoggingLevel = true)
{
//Set the minimum levelDebug that will be saved
$levelDebug = $this->defineLevelDebug($readLoggingLevel);
$this->setLevelDebug($levelDebug);
//Set path where the file will be saved
$pathFile = $this->definePathFile();
$this->setPathFile($pathFile);
@@ -98,7 +94,8 @@ class MonologProvider
$this->setFilePermission($permissionFile);
$this->setFormatter();
$this->setConfig($channel, $fileLog);
//Set the config: channel, fileLog and levelDebug that will be saved
$this->setConfig($channel, $fileLog, $readLoggingLevel);
$this->testWriteLog($channel, $fileLog, [
$pathFile
@@ -447,7 +444,7 @@ class MonologProvider
if (self::$instance === null) {
self::$instance = new MonologProvider($channel, $fileLog, $readLoggingLevel);
} else {
self::$instance->setConfig($channel, $fileLog);
self::$instance->setConfig($channel, $fileLog, $readLoggingLevel);
}
return self::$instance;
}
@@ -459,11 +456,14 @@ class MonologProvider
*
* @param string $channel The logging channel
* @param string $fileLog name file
* @param boolean $readLoggingLevel
*/
public function setConfig($channel, $fileLog)
public function setConfig($channel, $fileLog, $readLoggingLevel = true)
{
$this->setStream($fileLog);
$this->setLogger($channel);
$levelDebug = $this->defineLevelDebug($readLoggingLevel);
$this->setLevelDebug($levelDebug);
}
/**