I've tried to disable API request logging using this filter:
add_filter('edd_api_log_requests', '__return_false' );
But even with that in an mu-plugin, it fails to disable logging.
Scratch that, it works in an mu plugin, just fails in plugins loaded after EDD core. We may want to look at adjusting the $log_request parameter to be set later so that we can disable it through a plugin that uses plugins_loaded or similar.
I just ran into this myself, where I've added a custom endpoint and want just those requests to not be logged. I'm setting EDD_API->log_requests = false directly during my endpoint processing, but it'd be great to have an "official" way to change this that's forward-compatible.
Even just a EDD_API->disable_log() method would be handy so I know you're committed to keeping that function around.
@NateWr's approach is perfect. It also makes it possible to disable logging on certain endpoints, instead of disabling logging on _every_ endpoint. Obviously the edd_api_log_requests should still work, but I like having the option of keeping logging enabled for all but a few endpoints.
Ready for testing.
@sunnyratilal Having that method is nice but we still need to be able to disable it globally with the filter.
I'm at a loss here as to why the filter isn't working...
I've changed filter priorities, even have the entire EDD object instantiate on plugins_loaded but nothing seems to be doing the trick for me. 🤔
ignore my comment....derp. read @pippinsplugins 2nd comment.
Give that a shot.
Filter works fine for me too
💰
On Thu, Jan 12, 2017 at 7:39 PM Sunny Ratilal notifications@github.com
wrote:
Filter works fine for me too
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/easydigitaldownloads/easy-digital-downloads/issues/4486#issuecomment-272337837,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_HfaRhCn-1-nsQjvCJv7jyA3KuI5gJks5rRtXEgaJpZM4IFiSW
.
Most helpful comment
I just ran into this myself, where I've added a custom endpoint and want just those requests to not be logged. I'm setting
EDD_API->log_requests = falsedirectly during my endpoint processing, but it'd be great to have an "official" way to change this that's forward-compatible.Even just a
EDD_API->disable_log()method would be handy so I know you're committed to keeping that function around.