Skip to content

Instantly share code, notes, and snippets.

@meeuw
Created March 10, 2014 20:29
Show Gist options
  • Save meeuw/9473632 to your computer and use it in GitHub Desktop.
Save meeuw/9473632 to your computer and use it in GitHub Desktop.
log php backtrace to a file
<?php
$dmdbtf = fopen('/home/meeuw/log.txt', 'w');
function dmdbt($bt) {
global $dmdbtf;
if (isset($bt[0]['class']) && isset($bt[1]['class'])) {
fwrite($dmdbtf, "\"{$bt[1]['class']} {$bt[1]['function']}\" -> ".
"\"{$bt[0]['class']} {$bt[0]['function']}\"\n"
);
fflush($dmdbtf);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment