public function addLogger($name = 'log', $type = 'file', $options = ['log_location' => '/var/log/usf-logger.log', 'log_level' => 'warn'])
    {
        if (array_key_exists($name, $this->logRegistry)) {
            throw new \Exception('LogHandler named ['.$name.'] already exists.');
        }
        $this->logRegistry[$name] = new UsfLogger($name);
        $this->logRegistry[$name]->setDefaultLogLevel($this->defaultLogLevel);
        $this->logRegistry[$name]->addLogHandler($type, $options);

        //Add the web processor if this is not running on the command-line
        if (php_sapi_name() !== 'cli') {
            $this->logRegistry[$name]->addLogProcessor('web');
        }
    }
public function addLogger($name = 'log', $type = 'file', $options = ['log_location' => '/var/log/usf-logger.log', 'log_level' => 'warn'])
    {
        if (array_key_exists($name, $this->logRegistry)) {
            throw new \Exception('LogHandler named ['.$name.'] already exists.');
        }
        $this->logRegistry[$name] = new UsfLogger($name);
        $this->logRegistry[$name]->setDefaultLogLevel($this->defaultLogLevel);
        $this->logRegistry[$name]->addLogHandler($type, $options);

        //Add the web processor if this is not running on the command-line
        if (php_sapi_name() !== 'cli') {
            $this->logRegistry[$name]->addLogProcessor('web');
        }
    }
public function addLogger ( $ name = 'log' , $ type = 'file' , $ options = [ 'log_location' => '/var/log/usf-logger.log' , 'log_level' => 'warn' ] ) { if ( array_key_exists ( $ name , $ this -> logRegistry ) ) { throw new \ Exception ( 'LogHandler named [' . $ name . '] already exists.' ) ; } $ this -> logRegistry [ $ name ] = new UsfLogger ( $ name ) ; $ this -> logRegistry [ $ name ] -> setDefaultLogLevel ( $ this -> defaultLogLevel ) ; $ this -> logRegistry [ $ name ] -> addLogHandler ( $ type , $ options ) ; //Add the web processor if this is not running on the command-line if ( php_sapi_name ( ) !== 'cli' ) { $ this -> logRegistry [ $ name ] -> addLogProcessor ( 'web' ) ; } }
Add an UsfLogger object to the registry.

@param string $name    Name of the logging "channel"
@param string $type    Log handler to use
@param array  $options Configuration options for the log handler

@throws \Exception
Add an UsfLogger object to the registry .