Jump to content


This topic is now archived and is closed to further replies.


Access log

Recommended Posts

Can I make an own access log wit PHP? (because of trouble at the hosting provider no access log available sometimes)

I thought about two ways:

1) There is one file who is handling the website: index.php. If I put a code on the top of that file. That code writes the data to a file called access.log. After that I can use awstats or something to analyse the log. Can this be done? Will the performance of the site go down? Anyone?

2) I use already a database on the website. It will made different queries. I can put one query in that that would insert access log data into it. After that I can make a cronjob with a script who will read the databsase and write an access log. Then I can run awstats to analyse it. Is this good for the performance of the website?

Can anyone give me advice?


Share this post

Link to post
Share on other sites
I would go with option number 1.

Sure you could make an access log that awstats can parse, just make it in the same format as Apache's access.log.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.