Fix Stream writer, has been broken with syslog fix

This commit is contained in:
Thomas Gelf 2014-01-22 12:02:25 +00:00
parent 3008527b41
commit ad56868af5
1 changed files with 7 additions and 3 deletions

View File

@ -193,12 +193,16 @@ final class Logger
$target = Config::resolvePath($target);
// Make sure the permissions for log target file are correct
if ($type === 'Stream' && substr($target, 0, 6) !== 'php://' && !file_exists($target)) {
touch($target);
chmod($target, 0664);
if ($type === 'Stream') {
$writer = new $writerClass($target);
if (substr($target, 0, 6) !== 'php://' && !file_exists($target)) {
touch($target);
chmod($target, 0664);
}
} elseif ($type === 'Syslog') {
$writer = new $writerClass();
} else {
self::fatal('Got invalid lot type "%s"', $type);
}
$writer->addFilter(new Zend_Log_Filter_Priority($priority));