Previous Thread
Next Thread
Print Thread
Rate Thread
#226506 10/18/2002 8:25 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
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.

Here is an example of defining the parameter:

$config['mysql_log_dir'] = '/home/whatever/ubbthreads/logs';

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 (''):

$config['mysql_log_dir'] = '';

-----------------------------------------

Updated to version 1.0.1
Attachments
59158-mysql_error_log_1-0-1.zip (0 Bytes, 18 downloads)

Last edited by Dave_L; 10/22/2002 10:30 PM.
Sponsored Links
joeuser #226507 10/18/2002 8:43 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Dave?

Have I told you lately that you're a freekin' genius!



Thanks, I'm going to install this right now.

joeuser #226508 10/22/2002 2:50 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Updated to version 1.0.1 - Bug fix: log entries were same as displayed errors, instead of actual errors.

joeuser #226509 10/24/2002 1:52 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Thx, Dave_L!

That's a really useful hack.

-Fusion- #226510 10/24/2002 2:10 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
You're welcome.

My hacks don't seem to be very popular.

Sponsored Links
joeuser #226511 10/24/2002 2:50 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Dave your hacks and MySQL knowledge Rock!!!

I haven't installed this one yet... I got sidetracked.... but I've referred several people to your browser check script.

Thank you!

Daine #226512 10/24/2002 3:24 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768

joeuser #226513 10/25/2002 11:59 AM
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
I like it Will be putting this into the 6.2 version. Possibly adding an option in the admin section to view the logfiles as well.


UBB.threads Developer
Sally #226514 10/25/2002 12:03 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Sounds great! I really like this hack to and now I don't even have to bother to install it. =]

How about adding the AdminLogger hack I did as well?

Sally #226515 10/25/2002 12:17 PM
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768

Sponsored Links
c0bra #226516 10/25/2002 1:03 PM
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
That's the next one that I'm going to take a peek at.


UBB.threads Developer
joeuser #226517 10/25/2002 1:31 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Way to go Dave!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)