Show Logs in Console (only useful for headless or NAS Serviio servers) - Others please do not attempt.
Please make a backup of files you need to modify.
If you are like me, running serviio in an ubuntu headless or in a NAS, and constantly using IOS Devices or ServiioWeb to manage the serviio, also frequently having to use ssh
or WinSCP to review the serviio log, then this post might just for you. This adds serviio Log tab to ServiioWeb and displays current logs once clicked.
1. ServiioWeb/config.php add following to line 12 and modify log folder location as necessary.
- Code:
$log = "/usr/share/serviio/log/serviio.log";
2. ServiioWeb/content.php - replace line 9 with following:
- Code:
if ($tab!="library" && $tab!="metadata" && $tab!="delivery" && $tab!="about" && $tab!="presentation" && $tab!="remote" && $tab!="settings" && $tab!="about" && $tab!="log") {
3. ServiioWeb/index.php - add following line to index.php at line 359
- Code:
<li><a href="content.php?tab=log" rel="indexcontainer"><?php echo tr('tab_log','Log')?></a></li>
4. save following code as log.php in ServiioWeb/view folder.
- Code:
<html>
<head>
<title>Show Serviio Log</title>
</head>
<body>
<?php
include("../config.php");
$file = fopen( $log, "r") or exit('<strong><span style="color:#FF0000;text-align:left;"> Unable to open Serviio log file! </span></strong>');
//Output a line of the file until the end is reached
while(!feof($file))
{
echo fgets($file). "<br>";
}
fclose($file);
?>
</body>
</html>
NPuser