Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
ef8d083a
Commit
ef8d083a
authored
May 08, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add proxy logging (cache.log) to System logs
parent
6004b05d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
0 deletions
+73
-0
Menu.xml
src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml
+1
-0
diag_logs_proxy.php
src/www/diag_logs_proxy.php
+71
-0
diag_logs_tabs.inc
src/www/diag_logs_tabs.inc
+1
-0
No files found.
src/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml
View file @
ef8d083a
...
@@ -169,6 +169,7 @@
...
@@ -169,6 +169,7 @@
<LoadBalancer
url=
"/diag_logs_relayd.php"
/>
<LoadBalancer
url=
"/diag_logs_relayd.php"
/>
<OpenVPN
url=
"/diag_logs_openvpn.php"
/>
<OpenVPN
url=
"/diag_logs_openvpn.php"
/>
<NTP
url=
"/diag_logs_ntpd.php"
/>
<NTP
url=
"/diag_logs_ntpd.php"
/>
<Proxy
url=
"/diag_logs_proxy.php"
/>
<Settings
url=
"/diag_logs_settings.php"
/>
<Settings
url=
"/diag_logs_settings.php"
/>
</SystemLogs>
</SystemLogs>
...
...
src/www/diag_logs_proxy.php
0 → 100644
View file @
ef8d083a
<?php
/*
Copyright (C) 2015 Deciso B.V.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once
(
"guiconfig.inc"
);
$logfile
=
'/var/log/squid/cache.log'
;
$max_logentries
=
$config
[
'syslog'
][
'nentries'
];
if
(
!
$max_logentries
)
{
$max_logentries
=
50
;
}
if
(
$_POST
[
'clear'
])
{
// trash log file
$handle
=
fopen
(
$logfile
,
'r+'
);
ftruncate
(
$handle
,
0
);
fclose
(
$handle
);
}
$pgtitle
=
array
(
gettext
(
"Status"
),
gettext
(
"System logs"
),
gettext
(
"Proxy"
));
include
(
"head.inc"
);
?>
<body>
<?php
include
(
"fbegin.inc"
);
?>
<section
class=
"page-content-main"
>
<div
class=
"container-fluid"
>
<div
class=
"row"
>
<section
class=
"col-xs-12"
>
<?
include
(
'diag_logs_tabs.inc'
);
?>
<div
class=
"tab-content content-box col-xs-12"
>
<div
class=
"container-fluid"
>
<p>
<?php
printf
(
gettext
(
"Last %s log entries"
),
$max_logentries
);
?>
</p>
<pre>
<?php
echo
trim
(
implode
(
""
,
array_slice
(
file
(
$logfile
),
-
$max_logentries
)));
?>
</pre>
<form
method=
"post"
>
<input
name=
"clear"
type=
"submit"
class=
"btn"
value=
"
<?=
gettext
(
"Clear log"
);
?>
"
/>
</form>
</div>
</div>
</section>
</div>
</div>
</section>
<?php
include
(
"foot.inc"
);
?>
src/www/diag_logs_tabs.inc
View file @
ef8d083a
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
$tab_array
[]
=
array
(
gettext
(
"Load Balancer"
),
$active_tab
==
"/diag_logs_relayd.php"
,
"diag_logs_relayd.php"
);
$tab_array
[]
=
array
(
gettext
(
"Load Balancer"
),
$active_tab
==
"/diag_logs_relayd.php"
,
"diag_logs_relayd.php"
);
$tab_array
[]
=
array
(
gettext
(
"OpenVPN"
),
$active_tab
==
"/diag_logs_openvpn.php"
,
"diag_logs_openvpn.php"
);
$tab_array
[]
=
array
(
gettext
(
"OpenVPN"
),
$active_tab
==
"/diag_logs_openvpn.php"
,
"diag_logs_openvpn.php"
);
$tab_array
[]
=
array
(
gettext
(
"NTP"
),
$active_tab
==
"/diag_logs_ntpd.php"
,
"diag_logs_ntpd.php"
);
$tab_array
[]
=
array
(
gettext
(
"NTP"
),
$active_tab
==
"/diag_logs_ntpd.php"
,
"diag_logs_ntpd.php"
);
$tab_array
[]
=
array
(
gettext
(
"Proxy"
),
$active_tab
==
"/diag_logs_proxy.php"
,
"diag_logs_proxy.php"
);
$tab_array
[]
=
array
(
gettext
(
"Settings"
),
$active_tab
==
"/diag_logs_settings.php"
,
"diag_logs_settings.php"
);
$tab_array
[]
=
array
(
gettext
(
"Settings"
),
$active_tab
==
"/diag_logs_settings.php"
,
"diag_logs_settings.php"
);
display_top_tabs
(
$tab_array
);
display_top_tabs
(
$tab_array
);
?>
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment