NAME: MySQL Error Log VERSION: 1.0.1 DESCRIPTION: Log MySQL errors to a file. WORKING UNDER: UBB.threads 6.1.1 PREREQUISITES: none AUTHOR: Dave Lerner (Dave_L) CREDITS: none DEMO: none FILES ALTERED: mysql.inc.php, config.inc.php DATABASE ALTERED: no NEW FILES: none
HISTORY: 2002-10-18 Dave_L - 1.0.0 Original release 2002-10-22 Dave_L - 1.0.1 Bug fix: log entries were same as displayed errors, instead of actual errors.
******** ABSTRACT ********
When a MySQL database error occurs while using UBB.threads, the actual error is displayed only to administrators. This is good for security, but hinders diagnosing errors encountered by non-admistrator users.
This hack logs all the MySQL errors to a file. If a user reports an error, then an adminstrator with access to the log file can view the actual error that occurred.
When an error is logged, it is appended to the file "YYYYMMDD_mysql.log", which is created if it doesn't already exist, where YYYYMMDD represents the current date (YYYY = year, MM = month, DD = day). This naming convention allows old log files to be easily recognized and manually deleted.
The log entries are prefixed with the current date and time, the script file, and the username. The same date and time are also added to the displayed error message, to facilitate correlating the log file entry with the user's report.
To enable MySQL error logging, define the parameter "mysql_log_dir" in Admin/Edit config settings ("The following variables are unknown to the base UBB.threads package, but might be used by installed hacks or modifications to the program"). The parameter can also be defined by manually editing config.inc.php.
The value of this parameter is the absolute path to the log-file directory. This directory must be writable by the script.
################## It is recommended that this directory be outside the web document root, or otherwise protected from access by unauthorized users. ##################
To disable logging, either remove the parameter "mysql_log_dir", or set it to the empty string (''):
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.