Project

General

Profile

Download (19.4 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	diag_logs.php
4
*/
5
/* ====================================================================
6
 *  Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *
8
 *  Some or all of this file is based on the m0n0wall project which is
9
 *  Copyright (c)  2004 Manuel Kasper (BSD 2 clause)
10
 *
11
 *  Redistribution and use in source and binary forms, with or without modification,
12
 *  are permitted provided that the following conditions are met:
13
 *
14
 *  1. Redistributions of source code must retain the above copyright notice,
15
 *      this list of conditions and the following disclaimer.
16
 *
17
 *  2. Redistributions in binary form must reproduce the above copyright
18
 *      notice, this list of conditions and the following disclaimer in
19
 *      the documentation and/or other materials provided with the
20
 *      distribution.
21
 *
22
 *  3. All advertising materials mentioning features or use of this software
23
 *      must display the following acknowledgment:
24
 *      "This product includes software developed by the pfSense Project
25
 *       for use in the pfSense software distribution. (http://www.pfsense.org/).
26
 *
27
 *  4. The names "pfSense" and "pfSense Project" must not be used to
28
 *       endorse or promote products derived from this software without
29
 *       prior written permission. For written permission, please contact
30
 *       coreteam@pfsense.org.
31
 *
32
 *  5. Products derived from this software may not be called "pfSense"
33
 *      nor may "pfSense" appear in their names without prior written
34
 *      permission of the Electric Sheep Fencing, LLC.
35
 *
36
 *  6. Redistributions of any form whatsoever must retain the following
37
 *      acknowledgment:
38
 *
39
 *  "This product includes software developed by the pfSense Project
40
 *  for use in the pfSense software distribution (http://www.pfsense.org/).
41
 *
42
 *  THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
43
 *  EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44
 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
45
 *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
46
 *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48
 *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50
 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
51
 *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52
 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
53
 *  OF THE POSSIBILITY OF SUCH DAMAGE.
54
 *
55
 *  ====================================================================
56
 *
57
 */
58

    
59
/*
60
	pfSense_MODULE:	system
61
*/
62

    
63
##|+PRIV
64
##|*IDENT=page-diagnostics-logs-system
65
##|*NAME=Status: Logs: System
66
##|*DESCR=Allow access to the 'Status: System Logs: General' page.
67
##|*MATCH=diag_logs.php
68
##|-PRIV
69

    
70
require("guiconfig.inc");
71
require_once("filter_log.inc");
72

    
73
/*
74
Build a list of allowed log files so we can reject others to prevent the page
75
from acting on unauthorized files.
76
*/
77
$allowed_logs = array(
78
	"system" => array("name" => "General",
79
		    "shortcut" => ""),
80
	"dhcpd" => array("name" => "DHCP",
81
		    "shortcut" => "dhcp"),
82
	"portalauth" => array("name" => "Captive Portal Authentication",
83
		    "shortcut" => "captiveportal"),
84
	"ipsec" => array("name" => "IPsec",
85
		    "shortcut" => "ipsec"),
86
	"ppp" => array("name" => "PPP",
87
		    "shortcut" => ""),
88
	"relayd" => array("name" => "Load Balancer",
89
		    "shortcut" => "relayd"),
90
	"openvpn" => array("name" => "OpenVPN",
91
		    "shortcut" => "openvpn"),
92
	"ntpd" => array("name" => "NTPd",
93
		    "shortcut" => "ntp"),
94
	"gateways" => array("name" => "Gateways",
95
		    "shortcut" => "gateways"),
96
	"routing" => array("name" => "Routing",
97
		    "shortcut" => "routing"),
98
	"resolver" => array("name" => "DNS Resolver",
99
		    "shortcut" => "resolver"),
100
	"wireless" => array("name" => "Wireless",
101
		    "shortcut" => "wireless"),
102
);
103

    
104
// The logs to display are specified in a GET argument. Default to 'system' logs
105
if (!$_GET['logfile']) {
106
	$logfile = 'system';
107
} else {
108
	$logfile = $_GET['logfile'];
109
	if (!array_key_exists($logfile, $allowed_logs)) {
110
		/* Do not let someone attempt to load an unauthorized log. */
111
		$logfile = 'system';
112
	}
113
}
114

    
115
$system_logfile = "{$g['varlog_path']}/" . basename($logfile) . ".log";
116

    
117

    
118
function getGETPOSTsettingvalue($settingname, $default) {
119
	$settingvalue = $default;
120
	if ($_GET[$settingname]) {
121
		$settingvalue = $_GET[$settingname];
122
	}
123
	if ($_POST[$settingname]) {
124
		$settingvalue = $_POST[$settingname];
125
	}
126
	return $settingvalue;
127
}
128

    
129

    
130
$filtersubmit = getGETPOSTsettingvalue('filtersubmit', null);
131

    
132
if ($filtersubmit) {
133
	$filter_active = true;
134
	$filtertext = getGETPOSTsettingvalue('filtertext', "");
135
	$filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
136
}
137

    
138
$filterlogentries_submit = getGETPOSTsettingvalue('filterlogentries_submit', null);
139

    
140
if ($filterlogentries_submit) {
141
	$filter_active = true;
142
	$filterfieldsarray = array();
143

    
144
	$filterfieldsarray['time'] = getGETPOSTsettingvalue('filterlogentries_time', null);
145
	$filterfieldsarray['process'] = getGETPOSTsettingvalue('filterlogentries_process', null);
146
	$filterfieldsarray['pid'] = getGETPOSTsettingvalue('filterlogentries_pid', null);
147
	$filterfieldsarray['message'] = getGETPOSTsettingvalue('filterlogentries_message', null);
148
	$filterlogentries_qty = getGETPOSTsettingvalue('filterlogentries_qty', null);
149
}
150

    
151

    
152
# Manage Log - Code
153

    
154
$specific_log = basename($logfile) . '_settings';
155

    
156
$pconfig['cronorder'] = $config['syslog'][$specific_log]['cronorder'];
157
$pconfig['nentries'] = $config['syslog'][$specific_log]['nentries'];
158
$pconfig['logfilesize'] = $config['syslog'][$specific_log]['logfilesize'];
159
$pconfig['format'] = $config['syslog'][$specific_log]['format'];
160
$pconfig['loglighttpd'] = !isset($config['syslog']['nologlighttpd']);
161

    
162
$save_settings = getGETPOSTsettingvalue('save_settings', null);
163

    
164
if ($save_settings) {
165
	$cronorder = getGETPOSTsettingvalue('cronorder',  null);
166
	$nentries = getGETPOSTsettingvalue('nentries', null);
167
	$logfilesize = getGETPOSTsettingvalue('logfilesize', null);
168
	$format  = getGETPOSTsettingvalue('format',  null);
169
	$loglighttpd  = getGETPOSTsettingvalue('loglighttpd',  null);
170

    
171
	unset($input_errors);
172
	$pconfig = $_POST;
173

    
174
	/* input validation */
175
	if (isset($nentries) && (strlen($nentries) > 0)) {
176
		if (!is_numeric($nentries) || ($nentries < 5) || ($nentries > 2000)) {
177
			$input_errors[] = gettext("Number of log entries to show must be between 5 and 2000.");
178
		}
179
	}
180

    
181
	if (isset($logfilesize) && (strlen($logfilesize) > 0)) {
182
		if (!is_numeric($logfilesize) || ($logfilesize < 100000)) {
183
			$input_errors[] = gettext("Log file size must be numeric and greater than or equal to 100000.");
184
		}
185
	}
186

    
187
	if (!$input_errors) {
188

    
189
		# Clear out the specific log settings and leave only the applied settings to override the general logging options (global) settings.
190
		unset($config['syslog'][$specific_log]);
191

    
192
		if ($cronorder != '') { # if not using the general logging options setting (global)
193
			$config['syslog'][$specific_log]['cronorder'] = $cronorder;
194
		}
195

    
196
		if (isset($nentries) && (strlen($nentries) > 0)) {
197
			$config['syslog'][$specific_log]['nentries'] = (int)$nentries;
198
		}
199

    
200
		if (isset($logfilesize) && (strlen($logfilesize) > 0)) {
201
			$config['syslog'][$specific_log]['logfilesize'] = (int)$logfilesize;
202
		}
203

    
204
		if ($format != '') { # if not using the general logging options setting (global)
205
			$config['syslog'][$specific_log]['format'] = $format;
206
		}
207

    
208
		$oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
209
		if ($logfile == 'system') {
210
			$config['syslog']['nologlighttpd'] = $loglighttpd ? false : true;
211
		}
212

    
213
		write_config();
214

    
215
		$retval = 0;
216
		$savemsg = get_std_save_message($retval);
217

    
218
		if ($oldnologlighttpd !== isset($config['syslog']['nologlighttpd'])) {
219
			ob_flush();
220
			flush();
221
			log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
222
			send_event("service restart webgui");
223
			$savemsg .= "<br />" . gettext("WebGUI process is restarting.");
224
		}
225
	}
226
}
227

    
228

    
229
# Formatted/Raw Display
230
if ($config['syslog'][$specific_log]['format'] == 'formatted') {
231
	$rawfilter = false;
232
}
233
else if ($config['syslog'][$specific_log]['format'] == 'raw') {
234
	$rawfilter = true;
235
}	
236
else {	# Use the general logging options setting (global).
237
	$rawfilter = isset($config['syslog']['rawfilter']);
238
}
239

    
240

    
241
isset($config['syslog'][$specific_log]['nentries']) ? $nentries = $config['syslog'][$specific_log]['nentries'] : $nentries = $config['syslog']['nentries'];
242

    
243
# Override Display Quantity
244
if ($filterlogentries_qty) {
245
	$nentries = $filterlogentries_qty;
246
}
247

    
248
if (!$nentries || !is_numeric($nentries)) {
249
	$nentries = 50;
250
}
251

    
252
if ($_POST['clear']) {
253
	clear_log_file($system_logfile);
254
}
255

    
256
if ($filtertext) {
257
	$filtertextmeta="?filtertext=$filtertext";
258
}
259

    
260
/* Setup shortcuts if they exist */
261

    
262
if (!empty($allowed_logs[$logfile]["shortcut"])) {
263
	$shortcut_section = $allowed_logs[$logfile]["shortcut"];
264
}
265

    
266
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext($allowed_logs[$logfile]["name"]));
267
include("head.inc");
268

    
269
if (!$input_errors && $savemsg) {
270
	print_info_box($savemsg);
271
	$manage_log_active = false;
272
}
273

    
274
$tab_array = array();
275
$tab_array[] = array(gettext("System"), ($logfile == 'system'), "diag_logs.php");
276
$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
277
$tab_array[] = array(gettext("DHCP"), ($logfile == 'dhcpd'), "diag_logs.php?logfile=dhcpd");
278
$tab_array[] = array(gettext("Portal Auth"), ($logfile == 'portalauth'), "diag_logs.php?logfile=portalauth");
279
$tab_array[] = array(gettext("IPsec"), ($logfile == 'ipsec'), "diag_logs.php?logfile=ipsec");
280
$tab_array[] = array(gettext("PPP"), ($logfile == 'ppp'), "diag_logs.php?logfile=ppp");
281
$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
282
$tab_array[] = array(gettext("Load Balancer"), ($logfile == 'relayd'), "diag_logs.php?logfile=relayd");
283
$tab_array[] = array(gettext("OpenVPN"), ($logfile == 'openvpn'), "diag_logs.php?logfile=openvpn");
284
$tab_array[] = array(gettext("NTP"), ($logfile == 'ntpd'), "diag_logs.php?logfile=ntpd");
285
$tab_array[] = array(gettext("Settings"), false, "diag_logs_settings.php");
286
display_top_tabs($tab_array);
287

    
288
$tab_array = array();
289
if (in_array($logfile, array('system', 'gateways', 'routing', 'resolver', 'wireless')))	 {
290
	$tab_array[] = array(gettext("General"), ($logfile == 'system'), "/diag_logs.php");
291
	$tab_array[] = array(gettext("Gateways"), ($logfile == 'gateways'), "/diag_logs.php?logfile=gateways");
292
	$tab_array[] = array(gettext("Routing"), ($logfile == 'routing'), "/diag_logs.php?logfile=routing");
293
	$tab_array[] = array(gettext("Resolver"), ($logfile == 'resolver'), "/diag_logs.php?logfile=resolver");
294
	$tab_array[] = array(gettext("Wireless"), ($logfile == 'wireless'), "/diag_logs.php?logfile=wireless");
295
	display_top_tabs($tab_array, false, 'nav nav-tabs');
296
}
297

    
298
define(SEC_OPEN, 0x00);
299
define(SEC_CLOSED, 0x04);
300

    
301
if ($filter_active)
302
	$filter_state = SEC_OPEN;
303
else
304
	$filter_state = SEC_CLOSED;
305

    
306
if (!$rawfilter) { // Advanced log filter form
307
	$form = new Form(false);
308

    
309
	$section = new Form_Section('Advanced Log Filter', 'adv-filter-panel', COLLAPSIBLE|$filter_state);
310

    
311
	$group = new Form_Group('');
312

    
313
	$group->add(new Form_Input(
314
		'filterlogentries_time',
315
		null,
316
		'text',
317
		$filterfieldsarray['time']
318
	))->setWidth(3)->setHelp('Time');
319

    
320
	$group->add(new Form_Input(
321
		'filterlogentries_process',
322
		null,
323
		'text',
324
		$filterfieldsarray['process']
325
	))->setWidth(2)->setHelp('Process');
326

    
327
	$group->add(new Form_Input(
328
		'filterlogentries_pid',
329
		null,
330
		'text',
331
		$filterfieldsarray['pid']
332
	))->setWidth(2)->setHelp('PID');
333

    
334
	$group->add(new Form_Input(
335
		'filterlogentries_qty',
336
		null,
337
		'number',
338
		$filterlogentries_qty,
339
		['placeholder' => $nentries]
340
	))->setWidth(2)->setHelp('Quantity');
341

    
342
	$section->add($group);
343

    
344
	$group = new Form_Group('');
345

    
346
	$group->add(new Form_Input(
347
		'filterlogentries_message',
348
		null,
349
		'text',
350
		$filterfieldsarray['message']
351
	))->setWidth(7)->setHelp('Message');
352

    
353
	$btnsubmit = new Form_Button(
354
		'filterlogentries_submit',
355
		' ' . gettext('Apply Filter'),
356
		null,
357
		'fa-filter'
358
	);
359
}
360
else { // Simple log filter form
361
	$form = new Form(false);
362

    
363
	$section = new Form_Section('Log Filter', 'basic-filter-panel', COLLAPSIBLE|$filter_state);
364

    
365
	$group = new Form_Group('');
366

    
367
	$group->add(new Form_Input(
368
		'filtertext',
369
		null,
370
		'text',
371
		$filtertext
372
	))->setWidth(6)->setHelp('Filter Expression');
373

    
374
	$group->add(new Form_Input(
375
		'filterlogentries_qty',
376
		null,
377
		'number',
378
		$filterlogentries_qty,
379
		['placeholder' => $nentries]
380
	))->setWidth(2)->setHelp('Quantity');
381

    
382
	$btnsubmit = new Form_Button(
383
		'filtersubmit',
384
		' ' . gettext('Apply Filter'),
385
		null,
386
		'fa-filter'
387
	);
388
}
389

    
390
$btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm');
391

    
392
$group->add(new Form_StaticText(
393
	'',
394
	$btnsubmit
395
));
396

    
397
$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
398
$section->add($group);
399
$form->add($section);
400
print $form;
401

    
402
// Now the forms are complete we can draw the log table and its controls
403
if (!$rawfilter) {
404
	if ($filterlogentries_submit)
405
		$filterlog = conv_log_filter($system_logfile, $nentries, $nentries + 100, $filterfieldsarray);
406
	else
407
		$filterlog = conv_log_filter($system_logfile, $nentries, $nentries + 100, $filtertext);
408
?>
409

    
410
<div class="panel panel-default">
411
	<div class="panel-heading">
412
		<h2 class="panel-title">
413
<?php
414
	if ((!$filtertext) && (!$filterfieldsarray))
415
		printf(gettext("Last %d %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
416
	else
417
		printf(gettext("%d matched %s log entries."), count($filterlog), gettext($allowed_logs[$logfile]["name"]));
418

    
419
	printf(" (" . gettext("Maximum %d") . ")", $nentries);
420
?>
421
		</h2>
422
	</div>
423
	<div class="panel-body">
424
	   <div class="table-responsive">
425
		<table class="table table-striped table-hover table-compact">
426
			<tr>
427
				<th><?=gettext("Time")?></th>
428
				<th><?=gettext("Process")?></th>
429
				<th><?=gettext("PID")?></th>
430
				<th style="width:100%"><?=gettext("Log Message")?></th>
431
			</tr>
432
<?php
433
	foreach ($filterlog as $filterent) {
434
?>
435
			<tr>
436
				<td style="white-space:nowrap;">
437
					<?=htmlspecialchars($filterent['time'])?>
438
				</td>
439
				<td style="white-space:nowrap;">
440
					<?=htmlspecialchars($filterent['process'])?>
441
				</td>
442
				<td style="white-space:nowrap;">
443
					<?=htmlspecialchars($filterent['pid'])?>
444
				</td>
445
				<td style="word-wrap:break-word; word-break:break-all; white-space:normal">
446
					<?=htmlspecialchars($filterent['message'])?>
447
				</td>
448
			</tr>
449
<?php
450
	} // e-o-foreach
451
?>
452
		</table>
453
<?php
454
	if (count($filterlog) == 0)
455
		print_info_box(gettext('No logs to display'));
456
?>
457
		</div>
458
	</div>
459
</div>
460
<?php
461
}
462
else
463
{
464
?>
465
<div class="panel panel-default">
466
	<div class="panel-heading"><h2 class="panel-title"><?=gettext("Last ")?><?=$nentries?> <?=gettext($allowed_logs[$logfile]["name"])?><?=gettext(" log entries")?></h2></div>
467
	<div class="table table-responsive">
468
		<table class="table table-striped table-hover">
469
			<thead>
470
				<tr>
471
					<th class="col-sm-2"></th>
472
					<th></th>
473
				</tr>
474
			</thead>
475
			<tbody>
476
<?php
477
	if (($logfile == 'resolver') || ($logfile == 'system'))
478
		$inverse = array("ppp");
479
	else
480
		$inverse = null;
481

    
482
	if ($filtertext)
483
		$rows = dump_clog($system_logfile, $nentries, true, array("$filtertext"), $inverse);
484
	else
485
		$rows = dump_clog($system_logfile, $nentries, true, array(), $inverse);
486
?>
487
			</tbody>
488
		</table>
489
<?php
490
	if ($rows == 0)
491
		print_info_box(gettext('No logs to display'));
492
?>
493
	</div>
494
</div>
495
<?php
496
}
497
?>
498

    
499
<?php
500
# Manage Log - Section/Form
501

    
502
if ($input_errors) {
503
	print_input_errors($input_errors);
504
	$manage_log_active = true;
505
}
506

    
507
if ($manage_log_active)
508
	$manage_log_state = SEC_OPEN;
509
else
510
	$manage_log_state = SEC_CLOSED;
511

    
512
$form = new Form(false);
513

    
514
$section = new Form_Section(gettext('Manage') . ' ' . gettext($allowed_logs[$logfile]["name"]) . ' ' . gettext('Log'), 'log-manager-panel', COLLAPSIBLE|$manage_log_state);
515

    
516
$section->addInput(new Form_StaticText(
517
	'',
518
	'These settings override the "General Logging Options" settings.'
519
));
520

    
521
$group = new Form_Group('Forward/Reverse Display');
522

    
523
$group->add(new Form_Checkbox(
524
	'cronorder',
525
	null,
526
	'Forward',
527
	($pconfig['cronorder'] == 'forward') ? true : false,
528
	'forward'
529
))->displayAsRadio();
530

    
531
$group->add(new Form_Checkbox(
532
	'cronorder',
533
	null,
534
	'Reverse',
535
	($pconfig['cronorder'] == 'reverse') ? true : false,
536
	'reverse'
537
))->displayAsRadio();
538

    
539
$group->add(new Form_Checkbox(
540
	'cronorder',
541
	null,
542
	'General Logging Options Setting',
543
	($pconfig['cronorder'] == '') ? true : false,
544
	''
545
))->displayAsRadio();
546

    
547
$group->setHelp('Show log entries in forward (newest at bottom) or reverse (newest at top) order.');
548
$section->add($group);
549

    
550
$group = new Form_Group('GUI Log Entries');
551

    
552
# Use the general logging options setting (global) as placeholder.
553
$group->add(new Form_Input(
554
	'nentries',
555
	'GUI Log Entries',
556
	'number',
557
	$pconfig['nentries'],
558
	['placeholder' => $config['syslog']['nentries']]
559
))->setWidth(2);
560

    
561
$group->setHelp('This is the number of log entries displayed in the GUI. It does not affect how many entries are contained in the log.');
562
$section->add($group);
563

    
564
$group = new Form_Group('Log file size (Bytes)');
565

    
566
# Use the general logging options setting (global) as placeholder.
567
$group->add(new Form_Input(
568
	'logfilesize',
569
	'Log file size (Bytes)',
570
	'number',
571
	$pconfig['logfilesize'],
572
	['placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"]
573
))->setWidth(2);
574
$group->setHelp("The log is held in a constant-size circular log file. This field controls how large the log file is, and thus how many entries may exist inside the log. The default is approximately 500KB." .
575
					'<br /><br />' .
576
			"NOTE: The log size is changed the next time it is cleared. To immediately change the log size, first save the options to set the size, then clear the log using the \"Clear Log\" action below. ");
577
$section->add($group);
578

    
579
$group = new Form_Group('Formatted/Raw Display');
580

    
581
$group->add(new Form_Checkbox(
582
	'format',
583
	null,
584
	'Formatted',
585
	($pconfig['format'] == 'formatted') ? true : false,
586
	'formatted'
587
))->displayAsRadio();
588

    
589
$group->add(new Form_Checkbox(
590
	'format',
591
	null,
592
	'Raw',
593
	($pconfig['format'] == 'raw') ? true : false,
594
	'raw'
595
))->displayAsRadio();
596

    
597
$group->add(new Form_Checkbox(
598
	'format',
599
	null,
600
	'General Logging Options Setting',
601
	($pconfig['format'] == '') ? true : false,
602
	''
603
))->displayAsRadio();
604

    
605
$group->setHelp('Show the log entries as formatted or raw output as generated by the service. The raw output will reveal more detailed information, but it is more difficult to read.');
606
$section->add($group);
607

    
608
if ($logfile == 'system') {
609
	$section->addInput(new Form_Checkbox(
610
		'loglighttpd',
611
		'Web Server Log',
612
		'Log errors from the web server process',
613
		$pconfig['loglighttpd']
614
	))->setHelp('If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the system log.');
615
}
616

    
617
$btnsavesettings = new Form_Button(
618
	'save_settings',
619
	gettext('Save'),
620
	null
621
);
622

    
623
$btnsavesettings->addClass('btn-sm');
624

    
625
$btnclear = new Form_Button(
626
	'clear',
627
	' ' . gettext('Clear log'),
628
	null,
629
	'fa-trash'
630
);
631

    
632
$btnclear->removeClass('btn-primary')->addClass('btn-danger')->addClass('btn-sm');
633

    
634
$group = new Form_Group('Action');
635

    
636
$group->add(new Form_StaticText(
637
	'',
638
	$btnsavesettings
639
))->setHelp('Saves changed settings.');
640

    
641
$group->add(new Form_StaticText(
642
	'',
643
	$btnclear
644
))->setHelp('Clears local log file and reinitializes it as an empty log. Save any settings changes first.');
645

    
646
$section->add($group);
647
$form->add($section);
648
print $form;
649
?>
650

    
651
<?php include("foot.inc"); ?>
(20-20/228)