Project

General

Profile

« Previous | Next » 

Revision 1cf24f0a

Added by Jim Pingle almost 12 years ago

Add independent logging choices to disable logging of bogon network rules and private network rules. Add upgrade code to obey the existing behavior for users (if default block logging was disabled, so is bogon/private rule blocking). Also add a checkbox to disable the lighttpd log for people who don't want their system log spammed by lighty.

View differences:

usr/local/www/diag_logs_settings.php
63 63
$pconfig['system'] = isset($config['syslog']['system']);
64 64
$pconfig['enable'] = isset($config['syslog']['enable']);
65 65
$pconfig['logdefaultblock'] = !isset($config['syslog']['nologdefaultblock']);
66
$pconfig['logbogons'] = !isset($config['syslog']['nologbogons']);
67
$pconfig['logprivatenets'] = !isset($config['syslog']['nologprivatenets']);
68
$pconfig['loglighttpd'] = !isset($config['syslog']['nologlighttpd']);
66 69
$pconfig['rawfilter'] = isset($config['syslog']['rawfilter']);
67 70
$pconfig['filterdescriptions'] = $config['syslog']['filterdescriptions'];
68 71
$pconfig['disablelocallogging'] = isset($config['syslog']['disablelocallogging']);
......
115 118
		$config['syslog']['disablelocallogging'] = $_POST['disablelocallogging'] ? true : false;
116 119
		$config['syslog']['enable'] = $_POST['enable'] ? true : false;
117 120
		$oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']);
121
		$oldnologbogons = isset($config['syslog']['nologbogons']);
122
		$oldnologprivatenets = isset($config['syslog']['nologprivatenets']);
123
		$oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
118 124
		$config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true;
125
		$config['syslog']['nologbogons'] = $_POST['logbogons'] ? false : true;
126
		$config['syslog']['nologprivatenets'] = $_POST['logprivatenets'] ? false : true;
127
		$config['syslog']['nologlighttpd'] = $_POST['loglighttpd'] ? false : true;
119 128
		$config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false;
120 129
		if (is_numeric($_POST['filterdescriptions']) && $_POST['filterdescriptions'] > 0)
121 130
			$config['syslog']['filterdescriptions'] = $_POST['filterdescriptions'];
......
131 140

  
132 141
		$retval = 0;
133 142
		$retval = system_syslogd_start();
134
		if ($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock']))
143
		if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock']))
144
			|| ($oldnologbogons !== isset($config['syslog']['nologbogons']))
145
			|| ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets'])))
135 146
			$retval |= filter_configure();
136 147

  
137
		filter_pflog_start(true);
138

  
139 148
		$savemsg = get_std_save_message($retval);
149

  
150
		if ($oldnologlighttpd !== isset($config['syslog']['nologlighttpd'])) {
151
			ob_flush();
152
			flush();
153
			log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
154
			send_event("service restart webgui");
155
			$savemsg .= "<br />" . gettext("WebGUI process is restarting.");
156
		}
157

  
158
		filter_pflog_start(true);
140 159
	}
141 160
}
142 161

  
......
253 272
		</tr>
254 273
		<tr>
255 274
			<td valign="top" class="vtable">Log Firewall Default Blocks</td>
256
			<td class="vtable"> <input name="logdefaultblock" type="checkbox" id="logdefaultblock" value="yes" <?php if ($pconfig['logdefaultblock']) echo "checked"; ?>>
257
			<strong><?=gettext("Log packets blocked by the default rule");?></strong><br>
258
				<?=gettext("Hint: packets that are blocked by the " .
259
				"implicit default block rule will not be logged " .
260
				"if you uncheck this option. Per-rule logging options are still respected.");?></td>
275
			<td class="vtable">
276
				<input name="logdefaultblock" type="checkbox" id="logdefaultblock" value="yes" <?php if ($pconfig['logdefaultblock']) echo "checked"; ?>>
277
				<strong><?=gettext("Log packets blocked by the default rule");?></strong><br/>
278
				<?=gettext("Hint: packets that are blocked by the implicit default block rule will not be logged if you uncheck this option. Per-rule logging options are still respected.");?>
279
				<br/>
280
				<input name="logbogons" type="checkbox" id="logbogons" value="yes" <?php if ($pconfig['logbogons']) echo "checked"; ?>>
281
				<strong><?=gettext("Log packets blocked by 'Block Bogon Networks' rules");?></strong><br/>
282
				<br/>
283
				<input name="logprivatenets" type="checkbox" id="logprivatenets" value="yes" <?php if ($pconfig['logprivatenets']) echo "checked"; ?>>
284
				<strong><?=gettext("Log packets blocked by 'Block Private Networks' rules");?></strong><br/>
285
			</td>
286
		</tr>
287
		<tr>
288
			<td valign="top" class="vtable">Web Server Log</td>
289
			<td class="vtable"> <input name="loglighttpd" type="checkbox" id="loglighttpd" value="yes" <?php if ($pconfig['loglighttpd']) echo "checked"; ?>>
290
			<strong><?=gettext("Log errors from the web server process.");?></strong><br>
291
			<?=gettext("Hint: If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the main system log.");?></td>
261 292
		</tr>
262 293
		<tr>
263 294
			<td valign="top" class="vtable">Raw Logs</td>

Also available in: Unified diff