Closed (fixed)
Project:
RESTClient
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
22 Jan 2014 at 12:08 UTC
Updated:
3 Oct 2016 at 16:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
minoroffense commentedComment #2
CptCasual commentedAdded log for 301.
Restclient logs now take a parameter for the log severity level.
Comment #3
CptCasual commentedComment #4
minoroffense commentedFirst, when you submit a patch you should set it to "Needs Review" in the status.
Comment #5
minoroffense commentedNext, a few notes:
Comment #6
minoroffense commentedWhen you have a new patch, set the status back to "needs review"
Comment #7
CptCasual commentedChanged to log all 3XX response codes.
Modified the message. Note that the message is formatted in _restclient_watchdog.
Questions about if (variable_get('restclient_watchdog', TRUE))
1. Should it be checked on line 804? Or be moved inside _restclient_watchdog so the callers don't have to check it?
2. Would it be more correct to reverse the logic as: if (!variable_get('restclient_watchdog', FALSE))
Comment #8
CptCasual commentedComment #9
minoroffense commented1. Yeah moving that into the function makes sense. Do that.
2. What's the advantage to reversing the login? Are we changing the default behavior? If so we'll need to notify users and decide if it's worth it.
Comment #10
CptCasual commentedCurrently, if the restclient_watchdog config var is not present then the logs are on (TRUE) by default.
(Oops, comment 7 question 2 should not have the NOT.)
Comment #11
CptCasual commentedMoved the check for logging config into the log function.
Comment #12
CptCasual commentedAssigning to minorOffense for review.
Comment #13
CptCasual commentedUpdated the admin config text since Watchdog logs are not just for errors now.
Comment #14
CptCasual commentedComment #15
CptCasual commentedI had not added 3xx logs for POST and PUT. Fixed now.
IMPORTANT QUESTION: 5xx responses do not get logged because $response->error is not set. Should 5xx also get logged?
Comment #16
CptCasual commentedComment #17
minoroffense commentedYeah we could do 5XX responses too.
Only code change I would make is change the text to read "Enable logging" and add a #description to the form saying "Log error, redirect or not found responses".
Comment #18
CptCasual commentedChanged the config text, per review.
Have not implemented logging for 5xx.
Mat: Would you like me to create a new issue for logging 5xx?
Comment #19
minoroffense commentedYeah create a new issue
Comment #20
minoroffense commentedCan you rebuild this patch against the latest dev. Also, be sure to add a variable_del('restclient_watchdog') in hook_uninstall (see restclient.install for examples).
Comment #21
CptCasual commentedRebuilt patch against 7.x-2.x.
Added variable_del('restclient_watchdog') in hook_uninstall.
Comment #22
CptCasual commented@minorOffense : Does this stay as a patch or should I request a merge?
Comment #23
minoroffense commentedIf you have a working branch you can create the merge request in Gitlab.
Comment #24
CptCasual commentedComment #26
spotzero commentedFixed.