mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
parent
ca8e4ea924
commit
a24999ff7f
@ -5,6 +5,7 @@ namespace Icinga\Application\Logger\Writer;
|
|||||||
|
|
||||||
use Icinga\Application\Logger;
|
use Icinga\Application\Logger;
|
||||||
use Icinga\Application\Logger\LogWriter;
|
use Icinga\Application\Logger\LogWriter;
|
||||||
|
use Icinga\Exception\NotWritableError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log to the webserver log, a file or syslog
|
* Log to the webserver log, a file or syslog
|
||||||
@ -18,6 +19,8 @@ class PhpWriter extends LogWriter
|
|||||||
*/
|
*/
|
||||||
public function log($severity, $message)
|
public function log($severity, $message)
|
||||||
{
|
{
|
||||||
error_log(Logger::$levels[$severity] . ' - ' . str_replace("\n", ' ', $message));
|
if (! error_log(Logger::$levels[$severity] . ' - ' . str_replace("\n", ' ', $message))) {
|
||||||
|
throw new NotWritableError('Could not log to ' . (ini_get('error_log') ?: 'SAPI'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user