Subversion Repositories logviewer

Rev

Rev 7 | Rev 9 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7 Rev 8
Line 20... Line 20...
20
 
20
 
21
if (php_sapi_name() !== 'cli') {
21
if (php_sapi_name() !== 'cli') {
22
        die("Error: This script can only be called from command line.\n");
22
        die("Error: This script can only be called from command line.\n");
23
}
23
}
24
 
24
 
25
require_once __DIR__.'/../config.inc.php';
-
 
26
 
-
 
27
$hostname = trim(file_get_contents('/etc/hostname'));
25
$hostname = trim(file_get_contents('/etc/hostname'));
28
 
26
 
-
 
27
if (file_exists(__DIR__."/config_$hostname.inc.php")) {
-
 
28
        require_once __DIR__."/config_$hostname.inc.php";
-
 
29
} else {
-
 
30
        require_once __DIR__.'/config.inc.php';
-
 
31
}
-
 
32
 
29
if (file_exists(__DIR__."/../db_$hostname.inc.php")) {
33
if (file_exists(__DIR__."/../db_$hostname.inc.php")) {
30
        require_once __DIR__."/../db_$hostname.inc.php";
34
        require_once __DIR__."/../db_$hostname.inc.php";
31
} else {
35
} else {
32
        require_once __DIR__.'/../db.inc.php';
36
        require_once __DIR__.'/../db.inc.php';
33
}
37
}
Line 141... Line 145...
141
        $logfile = removeLogrotateSuffix($file);
145
        $logfile = removeLogrotateSuffix($file);
142
        foreach ($lines as $line) {
146
        foreach ($lines as $line) {
143
                $line_no++;
147
                $line_no++;
144
                $line = trim($line);
148
                $line = trim($line);
145
 
149
 
-
 
150
                echo "file $file_nr/$file_max (line $line_no/$line_max)                     \r";
-
 
151
 
146
                if (preg_match('@^\[(.*)\] ((.*)(\n ){0,1})$@ismU', $line, $m)) {
152
                if (preg_match('@^\[(.*)\] ((.*)(\n ){0,1})$@ismU', $line, $m)) {
147
                        # [19-Aug-2017 23:00:54 europe/berlin] PHP Notice:  Undefined variable: ssl in /home/viathinksoft/public_html/serverinfo/index.php on line 364
153
                        # [19-Aug-2017 23:00:54 europe/berlin] PHP Notice:  Undefined variable: ssl in /home/viathinksoft/public_html/serverinfo/index.php on line 364
148
                        $time = $m[1];
154
                        $time = $m[1];
149
                        $modul = '';
155
                        $modul = '';
150
                        $text = $m[2];
156
                        $text = $m[2];
Line 165... Line 171...
165
                } else {
171
                } else {
166
                        mysql_query("insert into vts_fehlerlog (modul, text, anzahl, letzter, logfile) " .
172
                        mysql_query("insert into vts_fehlerlog (modul, text, anzahl, letzter, logfile) " .
167
                                    "values ('".mysql_real_escape_string($modul)."', '".mysql_real_escape_string($text)."', 1, '".$time_mysql."', '".mysql_real_escape_string($logfile)."');");
173
                                    "values ('".mysql_real_escape_string($modul)."', '".mysql_real_escape_string($text)."', 1, '".$time_mysql."', '".mysql_real_escape_string($logfile)."');");
168
                        #echo mysql_error();
174
                        #echo mysql_error();
169
                }
175
                }
170
                echo "file $file_nr/$file_max (line $line_no/$line_max)                     \r";
-
 
171
        }
176
        }
172
 
177
 
173
        $cache[$file] = md5_file($file);
178
        $cache[$file] = md5_file($file);
174
}
179
}
175
echo "\n";
180
echo "\n";