PHP code example of elmijo / php-error-log

1. Go to this page and download the library: Download elmijo/php-error-log library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

elmijo / php-error-log example snippets




$logger = new PHPTools\PHPErrorLog\PHPErrorLog();

$logger->write('probando...');


$logger->write('PHPErrorLog: probando... logs');

$logger->write('MiSistema: probando... logs\n\t\notra forma de hacer logs');

$headers = array(
  'From'    => '[email protected]',
  'Subject' => 'Probando PHPErrorLog',
  'Cc'      => '[email protected]'
);

$logger->write('probando...',PEL_CRITICAL,"Jerry Anselmi <[email protected]>,Pedro Perez <[email protected]>,[email protected]",$headers);

$headers = array(
  'Content-type' => 'text/html; charset=iso-8859-1',
  'From'         => '[email protected]',
  'Subject'      => 'Probando PHPErrorLog',
  'Cc'           => '[email protected]'
);

$logger->write('<h1>PHPErrorLog</h1><br><p>probando...</p>',PEL_WARNING,"Jerry Anselmi <[email protected]>,Pedro Perez <[email protected]>,[email protected]",$headers);

$logger->write('probando...',PEL_ERROR,realpath('dev.log'));

$logger->write('probando...',PEL_DEBUG,'/ruta/absoluta/del/dev.log');