wlog

WLOG: '.$text;

    $filename = './wlog.log';
    $file = fopen( $filename, "a+" );
    if ( $file )
    {
        fputs ( $file, date("Y-m-d H:i:s").' '.$text."\n");
    }
    fclose ($file);
}

function wlogdump($i) {
    ob_start();
    print_r($i);
    $p = ob_get_contents();
    ob_end_clean();
    wlog($p);
}

function wlog_id()
{
         $length=6;

          $chars = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
          $clen   = strlen( $chars )-1;
          $id  = '';

          for ($i = 0; $i < $length; $i++) {
                  $id .= $chars[mt_rand(0,$clen)];
          }
          return ($id);
}

ini_set("display_errors","1");
ini_set("display_startup_errors","1");
ini_set('error_reporting', E_ALL);

require_once('./wlog.php');
$wlogid = wlog_id();

wlog(__FILE__.' CODE '.$wlogid.' start');
wlog(__FILE__.' CODE '.$wlogid.' AAA');
wlog(__FILE__.' CODE '.$wlogid.' end');

wlog(__FILE__.' EVENT 1111');
wlog(__CLASS__.'->'.__FUNCTION__.' OK');
wlog(__CLASS__.'->'.__FUNCTION__.' ERROR');

Clearing

# 1 remove require_once('./wlog.php');

# 2. find
find ./ -name '*.php' -exec grep -l 'wlog(' {} \;

# 3. delete included lines
find ./ -name '*.php' -exec grep -l 'wlog(' {} \; | xargs sed -i '/wlog(/d'

# 4 remove log files
find ./ -name wlog.log | xargs rm -f 
rm -f wlog.php