Ver Mensaje Individual
  #3 (permalink)  
Antiguo 02/12/2013, 18:43
Avatar de fcarrizalest
fcarrizalest
 
Fecha de Ingreso: diciembre-2013
Mensajes: 10
Antigüedad: 10 años, 5 meses
Puntos: 2
Respuesta: Guardar procedimientos en .txt

Hola yo hice este pequeño código para ir registrado todo en un script. en este caso y como comenta seria que fueras guardadndo este información en el txt claro ya seria que formatearas correctamente la salida. en mi caso estaba dando salida a un .html pues se ve mas bonito y se podia ver facilmente desde el explorador.

solo es abrir el txt agregar el nuevo log y listo

espero y te sirva y como implementarlo es sencillo

Código PHP:
 log::log"DEBU " "SQL " "TU sql " ); 

Saludos~
Código PHP:
class log {
    
    private static 
$instance;
    private 
$log;
    private 
$count;
    private 
$bind ;
    private function 
__construct() {
    
    }
    
    public static function 
logger() {
        
        if (! isset ( 
self::$instance )) {
            
$className __CLASS__;
            
self::$instance = new $className ();
        }
        return 
self::$instance;
    
    }
    
    public static function 
log($ID,$type,$mssage) {
        
        
        
log::logger()->addLog($ID,$type,$mssage);
        
        
    }
    
    public function 
addLog($ID,$type,$mssage){
        
        if (
$this->bind == ){
            
$this->bind 1;
        }else {
            
            
$color "#FFF8C6";
            
$this->bind 2;
        }
        
        
$this->log .= '<tr style="background-color: '.$color.'">';
        
        
        
$this->log .= '<td>  '.$ID.'  </td>
        
                        <td> '
.$type.' </td>
                        
                        <td> '
.$mssage.' </td>
                        
                        '    
;

        
$this->log .= '</tr>';
        
$this->count++;
        
    
    }
    
    public function 
buildReport(){
        
        if( 
$this->count )
        return 
'<fieldset> <legend> Report Error </legend> <table> <tr>  <td>  </td>  <td>   </td> <td>  </td>   </tr>   '.$this->log '</table> </fieldset>';
            else 
        return 
' ';
        
    }
    
    public function 
__clone() {
        
        
trigger_error 'Clone is not allowed.'E_USER_ERROR );
        
    }
    
    
    public function 
__wakeup() {
        
trigger_error 'Unserializing is not allowed.'E_USER_ERROR );
    }