Skip to content

Instantly share code, notes, and snippets.

@herewithme
Created June 1, 2020 04:36
Show Gist options
  • Save herewithme/9667aa2044c38be89faddbc02bdd5a5e to your computer and use it in GitHub Desktop.
Save herewithme/9667aa2044c38be89faddbc02bdd5a5e to your computer and use it in GitHub Desktop.
Add backtrace to log-http-requests WordPress plugin
<?php
add_filter( 'lhr_log_data',
function ( $data ) {
$backtrace = wp_debug_backtrace_summary();
$data['request_args'] = json_decode( $data['request_args'] );
$data['request_args']->backtrace = $backtrace;
$data['request_args'] = json_encode( $data['request_args'] );
return $data;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment