473,396 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Storing a history of what users do in a LOG file

258 100+
Hi everyone
I'v made a social networking website with PHP and now I'm trying to store a history of everything my users do in a file..
Here's the question:
Is it better to put it in a .log file and then download the file and save it on my computer at the end of each day OR putting them on a database table.

I think the second way takes a big amount of memory...
What's the regular way?

Thanks
Oct 12 '07 #1
7 2059
ak1dnar
1,584 Expert 1GB
History? what type of data you want to save in the history. is it URLs, updated records, user activities? anyway better to use a database for this, because it is easy to manage, once it compare with a flat file.
Oct 12 '07 #2
Motoma
3,237 Expert 2GB
I agree with ajaxrand's statement 100%. Not only are databases easier to deal with than flat files, they are easier to manage, and much more powerful when it comes to retrieving your data.
Oct 12 '07 #3
bnashenas1984
258 100+
Hi
Thank you for your replies.
Actualy I dont need to use these datas so much.. It's just for security. I mean I'm thinking to have a history of all users activities and if something like cheating or abusing happens then I can use this history to find the abuser...

heres an example of what I save:

(UserID: 27) Logged in with IP 213.100.20.74 at 4:00pm
(UserID: 27) Changed his/her profile pictire
(UserID: 27) Logged out at 6:30pm

Thanks again
Oct 12 '07 #4
Motoma
3,237 Expert 2GB
Hi
Thank you for your replies.
Actualy I dont need to use these datas so much.. It's just for security. I mean I'm thinking to have a history of all users activities and if something like cheating or abusing happens then I can use this history to find the abuser...

heres an example of what I save:

(UserID: 27) Logged in with IP 213.100.20.74 at 4:00pm
(UserID: 27) Changed his/her profile pictire
(UserID: 27) Logged out at 6:30pm

Thanks again
Okay, but consider this:
Lets say you suspect that there is a user account that is being shared, if you have your data in a database, a simple query can pull up login counts per day, time between logins, and excessive failed login attempts. On top of that, you with a simple SQL filter, you have have these reports automated for you, to alert you via email if an account seems suspicious.
Oct 12 '07 #5
pbmods
5,821 Expert 4TB
Heya, bnashenas1984.

If you store the data in a database, you can sort and filter it on a per-User basis, and you can then add Admin tools (email User, ban User, etc.) directly to the 'view log' page.

Note that you are introducing a *very minimal* amount of overhead by storing the data in the database, but it makes your life a whole lot more convenient, and isn't that what computers are all about?
Oct 12 '07 #6
bnashenas1984
258 100+
Thanks
You people realy have open minds. Sometimes you think about something I never do..
Thank you again for sharing your knowledge.
Oct 13 '07 #7
Markus
6,050 Expert 4TB
That's because they are GOD!!!!!!!!!!!
Oct 13 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a...
2
by: Nicki Pittman | last post by:
I have a web-based application that contains page with a form to allow a user to edit their account information (i.e. address, phone, email, etc.). This form is being pre-populated through XSLT...
7
by: Dave | last post by:
I have a system that basically stores a database within a database (I'm sure lots have you have done this before in some form or another). At the end of the day, I'm storing the actual data...
4
by: Junjie Wang | last post by:
It seems the aspx always is saved in IE history, how to write aspx that make IE does not save it ? Thanks. -Junjie
2
by: Shyam | last post by:
Hi, I wanted some advice on the following. All the users who log in to the system are created in the SQL Server. As I am not keen to store any user information on the web.config file for...
2
by: Jacek Dziedzic | last post by:
Hello! Suppose I have a class that contains only public members of builtin types and a default constructor. Because of the default constructor it is no longer an aggregate and therefore no...
6
by: (PeteCresswell) | last post by:
User wants to go this route instead of storing pointers in the DB and the documents outside. Only time I tried it was with only MS Word docs - and that was a loooong time ago - and it seemed to...
12
by: jim.richardson | last post by:
Hi all, I'd like a page to be excluded from the back button history, that is, when a user hits their browser's back button, it never backs into this particular page. Can anybody please tell...
1
by: Jonathan Wood | last post by:
My site includes a feature that allows users to upload an image. (Never more than one image per user.) I've been considering storing these uploaded images as a file on the server with a filename...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.