Re: Re: efficient log system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since there are probably a very limited number of actions a user can
take, you could probably easily reduce this by numbering each action:


define(1, 'logged in');
define(2, 'logged out');
define(3, 'uploaded photo');

Your DB then table might then look like:
user_id action_id notes
42      1         NULL
42      3         'whatever.jpg'
42      2         NULL

This could save a LOT of storage space over what it sounds like what
you are doing.

You also would want to write routines to aggregate and purge older data.

Whoops!  I forgot a time-stamp in the table.  Well, you'd have figured
that out on your own anyway. :-)

On Tue, June 12, 2007 6:40 am, Christian Hänsel wrote:
> Hello Alain,
>
> I can just tell you from my experience.
> I have recently created a, in my eyes, pretty big project, and wanted
> to
> track everything, starting from user navigation over search queries to
> login/out times, article printout times and count, photo views and
> everything your mind can imagine. I didn't do this for just the fun of
> it,
> but to see what our users do on our website and to improve the
> handling of
> the site.
>
> Anyhow, I think you get the idea. Now, what I've done, was to write
> all that
> into a mySQL database... and by now I think I shouldn't have done
> that. I
> did a DB-backup today (after 4 weeks of having the site up), and
> already the
> size of the DB is 10+ MB of textual data. What will it be after a
> year...
>
> So I guess it really depends on what you have in mind. I do store a
> lot of
> text data, so you might not even come up with 15% of what I'm saving.
> I
> think you should do some planning and try to see how many users will
> visit
> your page, and then calculate the amount of data your might be writing
> to
> files or a database. From my point of view, a database solution is
> just
> fine, until you have to restore that database from your local computer
> with
> a dump (uploading and all :oP)
>
> Just to show you what I dod and what amount of data I'm getting :o)
>
> Cheerio!
> Chris
>
>
>
> ""Alain Roger"" <raf.news@xxxxxxxxx> schrieb im Newsbeitrag
> news:75645bbb0706120426t44ea1ea3p46d752636c9ec31f@xxxxxxxxxxxxxxxxx
>> Hi,
>>
>> I would like to create a log system to keep a trace of all users'
>> actions
>> (log-in, remove, change or update data, and so on...).
>> What should i do or to what should i take care to not have problem ?
>>
>> I was thinking to create a folder on my server where log files will
>> be
>> stored, but what is the best practice.
>>
>> thanks a lot,
>>
>> --
>> Alain
>> ------------------------------------
>> Windows XP SP2
>> PostgreSQL 8.1.4
>> Apache 2.2.4
>> PHP 5.2.1
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux