arie_cristianD

trace file on error_log

May 14th, 2025 (edited)
806
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. function jnews_trace_log() {
  2.     $backtrance = debug_backtrace();
  3.  
  4.     $logs = array();
  5.     if ( is_array( $backtrance ) ) {
  6.         foreach ( $backtrance as $log ) {
  7.             if ( isset( $log['file'] ) && isset( $log['line'] ) ) {
  8.                 $logs[] = $log['file'] . ':' . $log['line'];
  9.             }
  10.         }
  11.     }
  12.     error_log( print_r( $logs, true ) );
  13. }
Advertisement
Add Comment
Please, Sign In to add comment