purgely icon indicating copy to clipboard operation
purgely copied to clipboard

Debug mode

Open tollmanz opened this issue 9 years ago • 2 comments

I receive an excellent suggestion from Fastly's support team to add a "debug" mode that logs, in one way or another, when purge requests have been made. They are reporting that when working with one client, they do not think that the purge requests are being made. Having some logging around these events would be really helpful for troubleshooting such issues.

tollmanz avatar Feb 29 '16 16:02 tollmanz

I'll +1 this. For a roughshod way to do this, Fastly had me add:

// adding logging
$datetime = date( "Y/m/d (D) H:i:s", time() );
error_log("Purgely Purge Log : ".$datetime." ".$request_uri."\n", 3, '<file>');

After line 114 of purgely/src/classes/purge-request.php (where is the destination for the log). This seemed to catch purges quite well. Obviously needs to be parameterized and enable-able.

orenwolf avatar Jun 28 '16 07:06 orenwolf

@orenwolf Thanks for the code! I think I'd like to do something along those lines. I might add some new actions and attach logging to those actions.

tollmanz avatar Jun 29 '16 16:06 tollmanz