Changeset 329
- Timestamp:
- Apr 9, 2008, 4:48:09 PM (17 years ago)
- Location:
- administrace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
administrace/debug_list.php
r320 r329 8 8 } 9 9 10 echo('<table><tr><td width="150px" valign="top">'); 10 echo('<table width="100%"><tr><td width="150px" valign="top">'); 11 echo('<strong>Restart list</strong><br>'); 11 12 12 13 $DbResult = $Database->query('SELECT Id, Time FROM debug WHERE 1 ORDER BY Time DESC'); 13 14 while($DbRow = $DbResult->fetch_array()) 14 15 { 15 echo('<a href="?Id='.$DbRow['Id'].' &Show=Backtrace">'.$DbRow['Time'].'</a><br>');16 echo('<a href="?Id='.$DbRow['Id'].'">'.str_replace(" ", " ", $DbRow['Time']).'</a><br>'); 16 17 } 17 18 … … 31 32 echo('<strong>MaxPlayerCount:</strong> '.$DbRow['MaxPlayerCount'].'<br><br>'); 32 33 echo('<a href="?Id='.$Id.'&Show=Backtrace">Backtrace</a>'. 33 ' <a href="?Id='.$Id.'&Show=Log">Console standard output log</a>'. 34 ' <a href="?Id='.$Id.'&Show=Error">Console error log</a><hr>'); 34 ' <a href="?Id='.$Id.'&Show=Log">Mangos log</a>'. 35 ' <a href="?Id='.$Id.'&Show=Error">Console error log</a>'. 36 ' <a href="?Id='.$Id.'&Show=DbErrors">Database error log</a><hr>'); 35 37 if(array_key_exists('Show', $_GET)) 36 38 { … … 39 41 { 40 42 case 'Backtrace': 41 echo('<strong>Backtrace:</strong> <br><pre>'. str_replace("\n", '<br>',$DbRow['Backtrace']).'</pre>');43 echo('<strong>Backtrace:</strong> <br><pre>'.htmlspecialchars($DbRow['Backtrace']).'</pre>'); 42 44 break; 43 45 case 'Log': 44 echo('<strong>Console standard output log:</strong> <br><pre>'. str_replace("\n", '<br>',$DbRow['Log']).'</pre>');46 echo('<strong>Console standard output log:</strong> <br><pre>'.htmlspecialchars($DbRow['Log']).'</pre>'); 45 47 break; 46 48 case 'Error': 47 echo('<strong>Console error log:</strong> <br><pre>'.str_replace("\n", '<br>', $DbRow['ErrorLog']).'</pre>'); 49 echo('<strong>Console error log:</strong> <br><pre>'.htmlspecialchars($DbRow['ErrorLog']).'</pre>'); 50 break; 51 case 'DbErrors': 52 echo('<strong>Database error log:</strong> <br><pre>'.htmlspecialchars($DbRow['DbErrors']).'</pre>'); 48 53 break; 49 54 } -
administrace/global.php
r320 r329 6 6 $StdOutLogFile = '/a/log/mangos/mangos-worldd.log'; 7 7 $ErrOutLogFile = '/a/log/mangos/mangos-worldd.err'; 8 $MangosLogFile = '/a/log/mangos/Server.log'; 9 $MangosDbErrorsLogFile = '/a/log/mangos/DBErrors.log'; 10 8 11 //$DatabaseHost = $Config['Database']['Host']; 9 12 //$DatabaseUser = '$Config['Database']['User']; -
administrace/process_log.php
r320 r329 1 1 <?php 2 2 3 chdir('/var/www/wow/administrace/'); 3 4 include('global.php'); 4 5 5 6 $Content = file_get_contents($StdOutLogFile); 6 7 $Lines = explode("\n", $Content); 8 $Content = ''; // Free unused memory 7 9 8 10 // Separate information from log file … … 15 17 $Backtrace = array_slice($Lines, $Line, count($Lines) - $Line); // Assume rest of file to be backtrace 16 18 $Backtrace = addslashes(implode("\n", $Backtrace)); 19 $Lines = ''; 17 20 18 $Log = array_slice($Lines, 0, $Line); 19 $Log = addslashes(implode("\n", $Log)); 20 21 $ErrorLog = addslashes(file_get_contents($ErrOutLogFile)); 21 //$Log = array_slice($Lines, 0, $Line); 22 //$Log = addslashes(implode("\n", $Log)); 22 23 23 24 // Get used database version from database … … 40 41 // Insert data in separate query to partly avoid too long query packet error 41 42 $Database->query('UPDATE `debug` SET Backtrace="'.$Backtrace.'" WHERE Id='.$InsertId); 42 echo($Database->error); 43 $Backtrace = ''; 44 //echo($Database->error); 45 $Log = addslashes(file_get_contents($MangosLogFile)); 43 46 $Database->query('UPDATE `debug` SET Log="'.$Log.'" WHERE Id='.$InsertId); 44 echo($Database->error); 45 $Database->query('UPDATE `debug` SET ErrorLog="'.$ErrorLog.'" WHERE Id='.$InsertId); 46 echo($Database->error); 47 //echo($Database->error); 48 $Log = addslashes(file_get_contents($ErrOutLogFile)); 49 $Database->query('UPDATE `debug` SET ErrorLog="'.$Log.'" WHERE Id='.$InsertId); 50 //echo($Database->error); 51 $Log = addslashes(file_get_contents($MangosDbErrorsLogFile)); 52 $Database->query('UPDATE `debug` SET DbErrors="'.$Log.'" WHERE Id='.$InsertId); 53 //echo($Database->error); 47 54 48 55 // Clear log files 56 unlink($MangosLogFile); 49 57 unlink($StdOutLogFile); 50 58 unlink($ErrOutLogFile); 59 unlink($MangosDbErrorsLogFile); 51 60 52 61 ?>
Note:
See TracChangeset
for help on using the changeset viewer.