Merge pull request #309 from linuxserver/goaccess-logfile

Add support for external logs in the swag dashboard
This commit is contained in:
quietsy
2022-03-19 12:35:48 +00:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -332,7 +332,7 @@ with-mouse false
# Specify the path to the input log file. If set, it will take
# priority over -f from the command line.
#
log-file /config/log/nginx/access.log
#log-file /config/log/nginx/access.log
# Send all debug messages to the specified file.
#
+2 -1
View File
@@ -252,7 +252,8 @@
$geodb = '';
endif;
$goaccess = shell_exec("/usr/local/bin/goaccess -a -o html --config-file=/dashboard/goaccess.conf ".$geodb);
$access_log = file_exists("/dashboard/logs") ? "/dashboard/logs/*.log" : "/config/log/nginx/access.log";
$goaccess = shell_exec("cat $access_log | /usr/local/bin/goaccess -a -o html --config-file=/dashboard/goaccess.conf $geodb -");
$goaccess = str_replace("<title>Server&nbsp;Statistics", "<title>SWAG&nbsp;Dashboard", $goaccess);
$goaccess = str_replace("<h1 class='h-dashboard'>", "<h1>", $goaccess);
$goaccess = str_replace("<i class='fa fa-tachometer'></i>", "<img src='/icon.svg' width='32' height='32'>&nbsp;SWAG&nbsp;", $goaccess);