System Log
The system log is located in System->System Log and can be helpful for monitoring operation of the system and fixing errors.
For the End User:
The system log displays any trapped errors that have occurred during the regular use of the system. Your in-house technical support should be contacted to investigate any errors that show in the system log. Technical support should review the logs regularly to determine if there are any errors that need to be corrected.
Log Fields:
ID - The auto-incremented ID from the MySQL database
Date/Time? - The date and time when the error occurred
Type - Is the error a database error, security issue or another type of error? Underlying error codes are numbered -400, -410, -420, -430, -440, -450, -460 (Database error)
Value - The resulting error text, as in the case below, "Could not connect to database server." + plus the exact query
User - The user that encountered or triggered the error
IP Address - The IP address of the client computer
For the programmer:
The system log traps and records errors thrown by the program code. The class "phpbmsLog" is located in include/session.php and simply writes to the log. The class "appError", also located in /include/session.php, is responsible for sorting out what to do with certain errors. (Not fully implemented though).
As an Example... The class "db", located in /include/db.php, is written to override the default MySQL errors thrown when something goes wrong with a query.
In the following code, we see that the connect() method overrides the standard php error reporting (which may or may not be enabled depending on your installation) and instead throws a "pretty" error message:
function connect(){
// This functions connects to the database. It uses pconnect if the variable is set;
if($this->pconnect)
$this->db_link = @ mysql_pconnect($this->hostname,$this->dbuser,$this->dbpass);
else
$this->db_link = @ mysql_connect($this->hostname,$this->dbuser,$this->dbpass);
if(!$this->db_link){
$error = new appError(-400,"Could not connect to database server.\n\n".mysql_error(),"",$this->showError,$this->stopOnError,false,$this->errorFormat);
return false;
} else
return $this->db_link;
}