Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
Hello again, folks! So lately I've noticed I'm not doing all I can to make my script as "unique" as I had originally planned. I guess using "fwrite" to create and store server log's is probably a bad idea. I'm still not sure how it would work, so could someone please explain to me how I would use MySQL to create logs? I'd like to log commands, bans, kicks, and all types of chat, including /o, /b, /me, /do, etc... So... How? Thanks!
Posts: 2,502
Threads: 26
Joined: Apr 2007
Reputation:
0
Using MySQL to log that kind of information would be much slower than using files, since you would be writing information quite often. It would be much more effecient to log certain information to individual files in a nice format for easy reading later.
Posts: 2,862
Threads: 11
Joined: Mar 2008
Reputation:
0
Just make sure that you thread you your queries and you are good to go. The big advantage of having logs stored in database is that you can easily find anything you are looking for.
Posts: 1,429
Threads: 50
Joined: Feb 2009
Reputation:
0
Maybe you could download the (temp) file using the FTP and then parse it to the website for example, and later just delete it. Probably it would be slow IMO, but thats the only solution I get.
Posts: 6,129
Threads: 36
Joined: Jan 2009
As Sergei said, as long as you thread queries, then you'll have little or no problems (paraphrased, of course). Aside from that, I'd assume that an INSERT query would be faster to process as it's sending data, not retrieving data and having to parse it through 3-4 different formats of variables (MySQL load into some form of plugin string > being split by '|' > being loaded from the plugin into pawn).
Quote:
Originally Posted by Luka P.
Maybe you could download the (temp) file using the FTP and then parse it to the website for example, and later just delete it. Probably it would be slow IMO, but thats the only solution I get.
|
MySQL would be faster than that.
Quote:
Originally Posted by mick88
I would be careful with that, I had a wonderful idea of threading all queries. Little did I know, my database supports only up to 10 connections and most queries simply failed, even those not threaded.
In other words, make sure your mysql server supports indefinite number of connections for one user.
|
I've never needed to use more than 1 connection, so yeah, I haven't experienced what you've had.