session logs.

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

session logs.

Post by jazcyk »

I want to get rid of those seesion logs 5 months old NOW. Can't wait for 1.6.

I think I would be safe to delete the log files and delete corresponding rows from the database (DELETE .. FROM .. WHERE time < cut_off_time). However the problem is WHERE. The sessions table uses a non-(human)readable time format.

Can you:

1) Confirm that it would be safe ??
2) Provide a 'conversion formula' for the time format used ?
Thorsten
Posts: 15758
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

admin log or user tracking logs?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

user

Post by jazcyk »

I was think of user logs primarily.

The log files take more than 20 MB here and the sessions table alone about 3 MB in the database. If numbers of visitors continue to grow it will be around or more than 100 MB by the end of this year in total.

It is not a disk space problem though. Mostly a backup problem. I have a Sceduled Backup running of everything once a day.

So I plan to extend this job to deleting old log files and running a SQLyog Notifications Service job deleting from the database corresponding rows in faqsessions table with the Scheduled Backup. Log of about 3 weeks only will be OK I think!

But yes ... Adminlog as well. But I think it will do to delete rows from table faqadminlog ? Is that safe too ? I don't totally understand the relation between tables faqadminlog and faqadminsessions ...
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

a small cosmetics ...

Post by jazcyk »

The 'View Sessions' from Admin Panel does not display days in correct date - order. I think you should reverse the format used here from DD-MM-YYYY to YYYY-MM-DD. That should solve it, I think!

Further the DD-MM-YYYY format is used in Continental Europe only. Most of the world uses YYYY-MM-DD or even YYYY-DD-MM. You could add some plain text telling that dates are sorted in YYYY-MM-DD -order.
Thorsten
Posts: 15758
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you can delete the tracking files in /data.

We plan a re-design of the logging feature for the next version.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

yes but ...

Post by jazcyk »

.. that was only half what I asked!

How do I find the corresponding rows in the database?
Thorsten
Posts: 15758
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

the corresponding rows are in the table faqsessions and they have a unix timestamp.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

aha ...

Post by jazcyk »

it is a Unix timestamp. Then I will have to study this.

But with a tool like this one:
http://www.4webhelp.net/us/timestamp.php
it should be pretty easy :D
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

so ...

Post by jazcyk »

in MySQL simply

Code: Select all

DELETE FROM faqsessions where time < UNIX_TIMESTAMP('2006-01-01 00:00:00');
to delete from database every user tracking log older than this month.
.. and then delete the corresponding log-files too using a wildcard.

Like this 25 MB becomes 5 MB :D

Thanks!

PS: That would be EASY to implement in Admin Panel!
Last edited by jazcyk on Sun Jan 29, 2006 2:02 pm, edited 1 time in total.
Thorsten
Posts: 15758
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

ah, great... this is something for 1.6, too. :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

MySQL docs

Post by jazcyk »

Thorsten
Posts: 15758
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

I know the function but we need ANSI SQL. :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply