Created
June 1, 2020 04:36
-
-
Save herewithme/9667aa2044c38be89faddbc02bdd5a5e to your computer and use it in GitHub Desktop.
Add backtrace to log-http-requests WordPress plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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