/trunk/README.md |
---|
1,5 → 1,15 |
# LogViewer |
**(English)** |
LogViewer is a small tool for Linux that reads out log files (usually from PHP) and saves them in a MySQL database. |
There, the errors are categorized and summarized according to the time and number of occurrences. |
The errors can be sorted and filtered via a web interface. Since the goal is to correct the problems, the error can be hidden with one click. It will then only be displayed if it appears again anyway. |
**(German)** |
LogViewer ist ein kleines Tool für Linux, das Logdateien (üblicherweise von PHP) ausliest und in eine MySQL-Datenbank speichert. |
Dort werden die Fehler kategorisiert und nach Eintrittszeitpunkt und Anzahl zusammengefasst. |
/trunk/ajax_cmd.php |
---|
19,10 → 19,14 |
if (!isset($_REQUEST['cmd'])) _err('cmd is missing'); |
$hostname = trim(file_get_contents('/etc/hostname')); |
if (file_exists(__DIR__."/config_$hostname.inc.php")) { |
require_once __DIR__."/config_$hostname.inc.php"; |
} else { |
require_once __DIR__.'/config.inc.php'; |
} |
$hostname = trim(file_get_contents('/etc/hostname')); |
if (file_exists(__DIR__."/db_$hostname.inc.php")) { |
require_once __DIR__."/db_$hostname.inc.php"; |
} else { |
/trunk/backend/insert_logs.sh |
---|
22,10 → 22,14 |
die("Error: This script can only be called from command line.\n"); |
} |
require_once __DIR__.'/../config.inc.php'; |
$hostname = trim(file_get_contents('/etc/hostname')); |
if (file_exists(__DIR__."/config_$hostname.inc.php")) { |
require_once __DIR__."/config_$hostname.inc.php"; |
} else { |
require_once __DIR__.'/config.inc.php'; |
} |
if (file_exists(__DIR__."/../db_$hostname.inc.php")) { |
require_once __DIR__."/../db_$hostname.inc.php"; |
} else { |
143,6 → 147,8 |
$line_no++; |
$line = trim($line); |
echo "file $file_nr/$file_max (line $line_no/$line_max) \r"; |
if (preg_match('@^\[(.*)\] ((.*)(\n ){0,1})$@ismU', $line, $m)) { |
# [19-Aug-2017 23:00:54 europe/berlin] PHP Notice: Undefined variable: ssl in /home/viathinksoft/public_html/serverinfo/index.php on line 364 |
$time = $m[1]; |
167,7 → 173,6 |
"values ('".mysql_real_escape_string($modul)."', '".mysql_real_escape_string($text)."', 1, '".$time_mysql."', '".mysql_real_escape_string($logfile)."');"); |
#echo mysql_error(); |
} |
echo "file $file_nr/$file_max (line $line_no/$line_max) \r"; |
} |
$cache[$file] = md5_file($file); |
/trunk/config.inc.php |
---|
21,10 → 21,9 |
define('MAXYEARS', 1); |
#define('apache_log_locations', array('/home/*/log/error*.log*', '/home/*/hosts/*/log/error*.log*', '/daten/admin/_probleme/php_codefixer/all_php_files.out')); |
define('apache_log_locations', array('/daten/admin/_probleme/php_codefixer/all_php_files.out')); |
define('apache_log_locations', array('/home/*/log/error*.log*', '/home/*/hosts/*/log/error*.log*', '/var/log/apache2/error*.log*')); |
define('php_log_locations', array('/home/*/log/php_error*.log*', '/home/*/hosts/*/log/php_error*.log*'/* , '/var/log/php/error.log*' */)); |
define('php_log_locations', array('/home/*/log/php_error*.log*', '/home/*/hosts/*/log/php_error*.log*', '/var/log/php/error.log*')); |
// 0 = No source is displayed |
// 1 = Columns "source" (=logfile) and "module" (module) |
/trunk/index.php |
---|
17,10 → 17,14 |
* limitations under the License. |
*/ |
$hostname = trim(file_get_contents('/etc/hostname')); |
if (file_exists(__DIR__."/config_$hostname.inc.php")) { |
require_once __DIR__."/config_$hostname.inc.php"; |
} else { |
require_once __DIR__.'/config.inc.php'; |
} |
$hostname = trim(file_get_contents('/etc/hostname')); |
if (file_exists(__DIR__."/db_$hostname.inc.php")) { |
require_once __DIR__."/db_$hostname.inc.php"; |
} else { |
/trunk/. |
---|
Property changes: |
Modified: svn:ignore |
-auth_viathinksoft.de.inc.php |
-db_viathinksoft.de.inc.php |
-style_viathinksoft.de.css |
+auth_*.inc.php |
+db_*.inc.php |
+config_*.inc.php |
+style_*.css |
.phpstan.tmp |
phpstan.neon |