Fix Stream writer, has been broken with syslog fix
This commit is contained in:
parent
3008527b41
commit
ad56868af5
|
@ -193,12 +193,16 @@ final class Logger
|
||||||
|
|
||||||
$target = Config::resolvePath($target);
|
$target = Config::resolvePath($target);
|
||||||
// Make sure the permissions for log target file are correct
|
// Make sure the permissions for log target file are correct
|
||||||
if ($type === 'Stream' && substr($target, 0, 6) !== 'php://' && !file_exists($target)) {
|
if ($type === 'Stream') {
|
||||||
|
$writer = new $writerClass($target);
|
||||||
|
if (substr($target, 0, 6) !== 'php://' && !file_exists($target)) {
|
||||||
touch($target);
|
touch($target);
|
||||||
chmod($target, 0664);
|
chmod($target, 0664);
|
||||||
$writer = new $writerClass($target);
|
}
|
||||||
} elseif ($type === 'Syslog') {
|
} elseif ($type === 'Syslog') {
|
||||||
$writer = new $writerClass();
|
$writer = new $writerClass();
|
||||||
|
} else {
|
||||||
|
self::fatal('Got invalid lot type "%s"', $type);
|
||||||
}
|
}
|
||||||
$writer->addFilter(new Zend_Log_Filter_Priority($priority));
|
$writer->addFilter(new Zend_Log_Filter_Priority($priority));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue