Subversion Repositories logviewer

Compare Revisions

No changes between revisions

Regard whitespace Rev 4 → Rev 5

/trunk/install/.htaccess
File deleted
/trunk/install/logviewer.sql
Cannot display: file marked as a binary type.
svn:mime-type = application/x-sql
Property changes:
Deleted: svn:mime-type
-application/x-sql
\ No newline at end of property
/trunk/INSTALL
1,5 → 1,5
 
1. Import install/logviewer.sql into your MySQL database
1. Import logviewer.sql into your MySQL database
 
2. Add MySQL login information to db.inc.php
 
/trunk/backend/insert_logs
34,20 → 34,30
 
$files = array();
foreach (apache_log_locations as $tpl) $files = array_merge($files, glob($tpl));
usort($files, create_function('$a,$b', 'return filemtime($a) - filemtime($b);'));
usort($files, function($a,$b) { return filemtime($a) - filemtime($b); });
 
$phpfiles = array();
foreach (php_log_locations as $tpl) $phpfiles = array_merge($phpfiles, glob($tpl));
usort($phpfiles, create_function('$a,$b', 'return filemtime($a) - filemtime($b);'));
usort($phpfiles, function($a,$b) { return filemtime($a) - filemtime($b); });
 
$file_nr = 0;
$file_max = count($files) + count($phpfiles);
 
$TMP_FILE = '/tmp/insert_logs.cache';
if (file_exists($TMP_FILE)) {
$cont = file_get_contents($TMP_FILE);
$cache = unserialize($cont);
} else {
$cache = array();
}
 
// Apache Log Files
 
foreach ($files as $file) {
$file_nr++;
 
if (isset($cache[$file]) && ($cache[$file] == md5_file($file))) continue;
 
if (time()-filemtime($file) > MAX_DAYS_LOGFILE * 3600) continue;
 
if (substr($file,-3,3) === '.gz') {
101,6 → 111,8
}
echo "file $file_nr/$file_max (line $line_no/$line_max) \r";
}
 
$cache[$file] = md5_file($file);
}
 
// PHP Log files
108,6 → 120,8
foreach ($phpfiles as $file) {
$file_nr++;
 
if (isset($cache[$file]) && ($cache[$file] == md5_file($file))) continue;
 
if (time()-filemtime($file) > MAX_DAYS_LOGFILE * 3600) continue;
 
if (substr($file,-3,3) === '.gz') {
155,9 → 169,13
}
echo "file $file_nr/$file_max (line $line_no/$line_max) \r";
}
 
$cache[$file] = md5_file($file);
}
echo "\n";
 
file_put_contents($TMP_FILE, serialize($cache));
 
# ---
 
function removeLogrotateSuffix($filename) {
/trunk/logviewer.sql
Cannot display: file marked as a binary type.
svn:mime-type = application/x-sql
Property changes:
Added: svn:mime-type
+application/x-sql
\ No newline at end of property