Mudsaf Posted August 29, 2013 Share Posted August 29, 2013 (edited) Hello, i'm wondering do you guys log user data what they do. New user registerations Logins & Logouts Page visits and other kind of form post information that the user does. Example I tried to make logging system & having over 70000 logs there (98% prob page refreshes). Also what mehod? .txt file or SQL-table? Edited August 29, 2013 by Mudsaf Link to comment Share on other sites More sharing options...
justsomeguy Posted August 29, 2013 Share Posted August 29, 2013 I store logs in the database and periodically archive them to a different table. Right now one of the large clients has about 200,000 entries in the active log and about 6.5 million entries in the archive. That might sound like a lot, but the same client has another table with 35 million records in it. The table only has 2 integer columns with a composite primary key and takes up 3.6GB of space. Link to comment Share on other sites More sharing options...
Mudsaf Posted August 29, 2013 Author Share Posted August 29, 2013 (edited) So basically i should do my logging with example TinyINT maxlength 3? ColumnsID (INT, AI, PRIMARY) | PROCESS (TINYINT 3, NOT NULL) | PROCESS2 (TINYINT3, NOT NULL) | IP (VARCHAR 15)1 | 1 | 1 | 127.0.0.1//Example ID, <page>, <what happened there>, <ip-address> Edited August 29, 2013 by Mudsaf Link to comment Share on other sites More sharing options...
justsomeguy Posted August 29, 2013 Share Posted August 29, 2013 That would help keep the size of the log table to a minimum. Most log entries have additional arbitrary text data associated with them though, except for static events (like a user logging in). 1 Link to comment Share on other sites More sharing options...
Mudsaf Posted August 29, 2013 Author Share Posted August 29, 2013 (edited) Well ill try to keep it at minimum, thanks for info. With 2x process i can track if user login logout. I have actually 10x10x10 (1000) options i could make with combinations on one page. Example Process 2 0 = Visit1 = Login2 = Logout3 = Form post success4 = Form post failure5 = MySQL error //Other than connection//.. and so on, ofc i have page data + user ip + other stuff up also. Edited August 29, 2013 by Mudsaf Link to comment Share on other sites More sharing options...
justsomeguy Posted August 29, 2013 Share Posted August 29, 2013 I understand, the additional data I'm referring to would be things specific to the event. If the event is an error, then the additional data would be an error code or error message or information about what they were doing. It's hard to assign a single number to that data. On my application, for example, if someone changes a piece of content or changes details about their account then the log message includes both the old and new data so that we can have an audit trail. It's more than just a finite list of possible messages. For yours, you probably want to know which form was being processed, and if it is a failure then what the failure was (which might include logging the submitted data). If it is a MySQL error, then you would probably want to record the error number or error message and the query, filename, and line number that caused it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now