Sean's 4/16 notes: Difference between revisions

From Earlham CS Department
Jump to navigation Jump to search
Sawibel07 (talk | contribs)
Created page with "Suspicious: controller/main.php initializes $error = "". The comment says $error is used to store the last/current error message. This is the last line of the script, so who kn..."
 
Sawibel07 (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Suspicious: controller/main.php initializes $error = "". The comment says
Suspicious: controller/main.php initializes $error = "". The comment says $error is used to store the last/current error message. This is the last line of the script, so who knows what's happening to it.
$error is used to store the last/current error message. This is the last
line of the script, so who knows what's happening to it.


Very Suspcicious: util/log.php has $LOG_FILE = "../logs/posit_web.txt",
Very Suspcicious: util/log.php has $LOG_FILE = "../logs/posit_web.txt", but the only file in logs/ is log.txt.
  but the only file in logs/ is log.txt.
There is what appears to be a constant, LOG, in line 22. It's in config.php at line 23, and is initialized to true. This is also where they define where they're actually putting the log (logs/log.txt).
There is what appears to be a constant, LOG, in line 22. It's in config.php
  at line 23, and is initialized to true. This is also where they
  define where they're actually putting the log (logs/log.txt).




**We got rid of the line in util/log.php that initializes $LOG_FILE because
We got rid of the line in util/log.php that initializes $LOG_FILE because it's not used ANYWHERE; it's actually using "LOG_FILE" which was defined as "./logs/log.txt" in config.php.
  it's not used ANYWHERE; it's actually using "LOG_FILE" which was defined as
 
  "./logs/log.txt" in config.php.
util/log.php currently uses the following date format: "h-i-s, j-m-y". We changed it to "M d H:i:s" so it's significantly more readable.
Note: this doesn't include year.


util/log.php currently uses the following date format: "h-i-s, j-m-y"
We changed it to "M d H:i:s" so it's significantly more readable.
Note: this doesn't include year.
Is there a log-rotator?
Is there a log-rotator?
Also, should we start saving the log in a system-standard place?
Also, should we start saving the log in a system-standard place?


What gets put in the log:
What gets put in the log: In controller/web.php, ANYTHING that calls the function webController logs the path and request passed to the webController function.
In controller/web.php, ANYTHING that calls the function webController logs
  the path and request passed to the webController function.




We deleted the commented-out statement that just wrote "Requested server" to
We deleted the commented-out statement that just wrote "Requested server" to the log every time webController was called. Also deleted it from controller/api.php.
the log every time webController was called.
Also deleted it from controller/api.php




A lot of errors, at least in api.php, are getting grabbed with "jsonError"
A lot of errors, at least in api.php, are getting grabbed with "jsonError" or some similar thing. So they're pobably being logged somewhere - but where?
or some similar thing. So they're pobably being logged somewhere - but where?

Latest revision as of 02:33, 17 April 2012

Suspicious: controller/main.php initializes $error = "". The comment says $error is used to store the last/current error message. This is the last line of the script, so who knows what's happening to it.

Very Suspcicious: util/log.php has $LOG_FILE = "../logs/posit_web.txt", but the only file in logs/ is log.txt. There is what appears to be a constant, LOG, in line 22. It's in config.php at line 23, and is initialized to true. This is also where they define where they're actually putting the log (logs/log.txt).


We got rid of the line in util/log.php that initializes $LOG_FILE because it's not used ANYWHERE; it's actually using "LOG_FILE" which was defined as "./logs/log.txt" in config.php.

util/log.php currently uses the following date format: "h-i-s, j-m-y". We changed it to "M d H:i:s" so it's significantly more readable. Note: this doesn't include year.

Is there a log-rotator? Also, should we start saving the log in a system-standard place?

What gets put in the log: In controller/web.php, ANYTHING that calls the function webController logs the path and request passed to the webController function.


We deleted the commented-out statement that just wrote "Requested server" to the log every time webController was called. Also deleted it from controller/api.php.


A lot of errors, at least in api.php, are getting grabbed with "jsonError" or some similar thing. So they're pobably being logged somewhere - but where?