mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-02 12:57:35 +01:00
context.php: report deprecation notice on syslog option
This commit is contained in:
parent
68165c35ca
commit
a25f56e461
@ -40,9 +40,15 @@ function build_context(array $config): Context {
|
|||||||
$level = $config['debug'] ? LogDriver::DEBUG : LogDriver::NOTICE;
|
$level = $config['debug'] ? LogDriver::DEBUG : LogDriver::NOTICE;
|
||||||
$backend = $config['log_system']['type'];
|
$backend = $config['log_system']['type'];
|
||||||
|
|
||||||
|
$legacy_syslog = isset($config['syslog']) && $config['syslog'];
|
||||||
|
|
||||||
// Check 'syslog' for backwards compatibility.
|
// Check 'syslog' for backwards compatibility.
|
||||||
if ((isset($config['syslog']) && $config['syslog']) || $backend === 'syslog') {
|
if ($legacy_syslog || $backend === 'syslog') {
|
||||||
return new SyslogLogDriver($name, $level, $config['log_system']['syslog_stderr']);
|
$log_driver = new SyslogLogDriver($name, $level, $config['log_system']['syslog_stderr']);
|
||||||
|
if ($legacy_syslog) {
|
||||||
|
$log_driver->log(LogDriver::NOTICE, 'The configuration setting \'syslog\' is deprecated. Please use \'log_system\' instead');
|
||||||
|
}
|
||||||
|
return $log_driver;
|
||||||
} elseif ($backend === 'file') {
|
} elseif ($backend === 'file') {
|
||||||
return new FileLogDriver($name, $level, $config['log_system']['file_path']);
|
return new FileLogDriver($name, $level, $config['log_system']['file_path']);
|
||||||
} elseif ($backend === 'stderr') {
|
} elseif ($backend === 'stderr') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user