Bug #1284 » pfsense_syslog.diff
| etc/inc/system.inc | ||
|---|---|---|
|
mwexec("/usr/bin/killall -9 fifolog_writer");
|
||
|
|
||
|
// Define carious commands for logging
|
||
|
$syslog_create = "/usr/bin/touch ";
|
||
|
$syslog_log = "";
|
||
|
$syslog_size = "";
|
||
|
$fifolog_create = "/usr/sbin/fifolog_create -s ";
|
||
|
$fifolog_log = "|/usr/sbin/fifolog_writer ";
|
||
|
$fifolog_size = "10240";
|
||
|
$clog_create = "/usr/sbin/clog -i -s ";
|
||
|
$clog_log = "%";
|
||
|
$clog_size = "10240";
|
||
|
// Which logging type are we using this week??
|
||
|
if(isset($config['system']['usefifolog'])) {
|
||
|
if(isset($config['system']['disablesyslogclog'])) {
|
||
|
$log_directive = $syslog_log;
|
||
|
$log_create_directive = $syslog_create;
|
||
|
$log_size = $syslog_size;
|
||
|
} else if(isset($config['system']['usefifolog'])) {
|
||
|
$log_directive = $fifolog_log;
|
||
|
$log_create_directive = $fifolog_create;
|
||
|
$log_size = $fifolog_size;
|
||
|
} else { // Defaults to CLOG
|
||
|
$log_directive = $clog_log;
|
||
|
$log_create_directive = $clog_create;
|
||
|
$log_size = $clog_size;
|
||
|
}
|
||
|
|
||
|
if (isset($syslogcfg)) {
|
||
| ... | ... | |
|
foreach($config['installedpackages']['package'] as $package) {
|
||
|
if($package['logging']) {
|
||
|
array_push($separatelogfacilities, $package['logging']['facilityname']);
|
||
|
mwexec("{$log_create_directive} 10240 {$g['varlog_path']}/{$package['logging']['logfilename']}");
|
||
|
mwexec("{$log_create_directive} {$log_size} {$g['varlog_path']}/{$package['logging']['logfilename']}");
|
||
|
$syslogconf .= "!{$package['logging']['facilityname']}\n*.*\t\t\t\t\t\t {$log_directive}{$g['varlog_path']}/{$package['logging']['logfilename']}\n";
|
||
|
}
|
||
|
}
|
||