Project

General

Profile

Bug #1284 » pfsense_syslog.diff

Vinícius Coque, 02/17/2011 01:05 PM

View differences:

etc/inc/system.inc
443 443
		mwexec("/usr/bin/killall -9 fifolog_writer");
444 444
	
445 445
	// Define carious commands for logging
446
	$syslog_create = "/usr/bin/touch ";
447
	$syslog_log = "";
448
	$syslog_size = "";
446 449
	$fifolog_create = "/usr/sbin/fifolog_create -s ";
447 450
	$fifolog_log = "|/usr/sbin/fifolog_writer ";
451
	$fifolog_size = "10240";
448 452
	$clog_create = "/usr/sbin/clog -i -s ";
449 453
	$clog_log = "%";
454
	$clog_size = "10240";
450 455

  
451 456
	// Which logging type are we using this week??
452
	if(isset($config['system']['usefifolog'])) {
457
	if(isset($config['system']['disablesyslogclog'])) {
458
		$log_directive = $syslog_log;
459
		$log_create_directive = $syslog_create;
460
		$log_size = $syslog_size;
461
	} else if(isset($config['system']['usefifolog'])) {
453 462
		$log_directive = $fifolog_log;
454 463
		$log_create_directive = $fifolog_create;		
464
		$log_size = $fifolog_size;
455 465
	} else { // Defaults to CLOG
456 466
		$log_directive = $clog_log;
457 467
		$log_create_directive = $clog_create;
468
		$log_size = $clog_size;
458 469
	}
459 470
	
460 471
	if (isset($syslogcfg)) {
......
463 474
			foreach($config['installedpackages']['package'] as $package) {
464 475
				if($package['logging']) {
465 476
					array_push($separatelogfacilities, $package['logging']['facilityname']);
466
					mwexec("{$log_create_directive} 10240 {$g['varlog_path']}/{$package['logging']['logfilename']}");
477
					mwexec("{$log_create_directive} {$log_size} {$g['varlog_path']}/{$package['logging']['logfilename']}");
467 478
					$syslogconf .= "!{$package['logging']['facilityname']}\n*.*\t\t\t\t\t\t {$log_directive}{$g['varlog_path']}/{$package['logging']['logfilename']}\n";
468 479
				}
469 480
			}
    (1-1/1)