Ignore:
Timestamp:
Apr 9, 2008, 4:48:09 PM (17 years ago)
Author:
george
Message:

Upraveno: Optimalizace a opravy systému zaznamenávání ladících informací o pádech serveru.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • administrace/process_log.php

    r320 r329  
    11<?php
    22
     3chdir('/var/www/wow/administrace/');
    34include('global.php');
    45
    56$Content = file_get_contents($StdOutLogFile);
    67$Lines = explode("\n", $Content);
     8$Content = ''; // Free unused memory
    79
    810// Separate information from log file
     
    1517$Backtrace = array_slice($Lines, $Line, count($Lines) - $Line);   // Assume rest of file to be backtrace
    1618$Backtrace = addslashes(implode("\n", $Backtrace));
     19$Lines = '';
    1720
    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));
    2223
    2324// Get used database version from database
     
    4041// Insert data in separate query to partly avoid too long query packet error
    4142$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));
    4346$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);
    4754
    4855// Clear log files
     56unlink($MangosLogFile);
    4957unlink($StdOutLogFile);
    5058unlink($ErrOutLogFile);
     59unlink($MangosDbErrorsLogFile);
    5160
    5261?>
Note: See TracChangeset for help on using the changeset viewer.