SimpleSAML\Logger\FileLoggingHandler::__construct PHP Method

__construct() public method

Build a new logging handler based on files.
public __construct ( SimpleSAML_Configuration $config )
$config SimpleSAML_Configuration
    public function __construct(\SimpleSAML_Configuration $config)
    {
        // get the metadata handler option from the configuration
        $this->logFile = $config->getPathValue('loggingdir', 'log/') . $config->getString('logging.logfile', 'simplesamlphp.log');
        $this->processname = $config->getString('logging.processname', 'SimpleSAMLphp');
        if (@file_exists($this->logFile)) {
            if (!@is_writeable($this->logFile)) {
                throw new \Exception("Could not write to logfile: " . $this->logFile);
            }
        } else {
            if (!@touch($this->logFile)) {
                throw new \Exception("Could not create logfile: " . $this->logFile . " The logging directory is not writable for the web server user.");
            }
        }
        \SimpleSAML\Utils\Time::initTimezone();
    }