homepage Welcome to WebmasterWorld Guest from 54.227.160.102
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
Home made logging? Unwise?
mysql log
salewit

10+ Year Member



 
Msg#: 4177518 posted 8:52 pm on Jul 27, 2010 (gmt 0)

I am on shared hosting, and run a small e-commerce site that is database driven (mysql).

Since I am on shared hosting, I have no access to the mysql logs. More than several times I've accidentally deleted or changed something and had to go through old backups to restore it. So I thought about creating my own log .. something along the lines of a function i.e.

function runsql($command) {
$response = mysql_query($command);
$log = "INSERT into homemadelog ('key','command','added') values ('','$x',NOW());";
$y = mysql_query($log);
}

I know this is a hard question to answer, but I'm wondering whether this will overload the server in any way? Some pages use mysql more than others, but some of the popular pages have probably 10-20 query's. This would in effect double that.

 

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4177518 posted 1:36 am on Jul 29, 2010 (gmt 0)

>> More than several times I've accidentally deleted or changed something and had to go through old backups to restore it

I don't see how keeping a log of this nature helps you with this problem. Perhaps you could explain? Do you keep backups of the file system as well? Do you use version control software? All things to think about.

I personally thing logging every query is not necessary. Especially since you now have to go back and modify your entire CMS every time you query the tables. If you are worried about security issues then you should only use a user id that has privileges to the specific things it needs to do to the tables it needs to do them. Most of the time this is SELECT, and ever so often an UPDATE or DELETE.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved