Linux Systems Administrator
Jupitermedia
US-AZ-Tucson

Justtechjobs.com Post A Job | Post A Resume

Creating Your Own Log Files
What to do if your domain host does not allow you to read the server log for your domain, stopping you from analyzing your website traffic the way you'd like to? Well, create your own logfile of course !
I recently set up a new domain (coolt.nu, it's in Swedish, you might not want to visit it :) and faced the problem that my domain host wouldn't generate the statistics I wanted. I also found that they would not let me read/process the logfile myself. Darn shame, but I did find a second-best solution: I created my own logfile. It didn't give me quite as much information as I would have wanted, but I it had to be enough.
The only thing you can log from within PHP is actual hits, no errors, no '304 Not Modified' and no 'Internal Server Error' entries can be generated, as your code will have to be executed to be able to generate logfile entries. This was not a problem to me, because all I wanted to know was which pages on my site got the actual hits, and when they occurred.
I ended up with a small script that extracted all the appropriate environment variables, put them together as a Common Logfile Format entry and wrote it to a file. Good enough for me, because then I could use any logfile analyzer that supports that format (and there's lots of those).
[ Next Page ]


Comments:
negate the if statement?Peter08/24/07 04:51
Java to php Sunny12/14/05 09:47
RE: how get book in pdf for PHPWes05/12/05 00:57
RE: HELP!Wes05/12/05 00:55
which tool i can use a log fileDeepak Se12/06/04 09:44
help!miaka11/12/02 05:20
RE: emailSwetha Balla10/28/02 23:46
what is phpabialsh 09/18/02 04:04
HELP!Nikki Tavasoli09/06/02 20:33
which tool i can use a log filesomeone09/06/02 18:56
Can I use PHPt o develop tools for internet MRUTAYISIRE PATRICK07/31/02 11:40
how get book in pdf for PHPeli07/09/02 15:35
Simple Logging??Chris McCarty06/07/02 17:36
RE: problem working?Catherine05/17/02 16:29
RE: Use this to log into a table:Catherine05/17/02 16:27
To view log file in webprasad04/09/02 08:04
? How to get this working....?Sili03/15/02 11:29
to view log file in webrosli03/09/02 00:14
RE: I have got this script working,, but....mika02/02/02 09:34
Uploading php fileVishal01/16/02 11:57
RE: can anyboday tell me how to make a login Joshua01/12/02 20:48
RE: can anyboday tell me how to make a login Maresal01/01/02 17:44
how to create set up fileskiran12/11/01 06:33
can anyboday tell me how to make a login fernanciso10/30/01 04:00
I have got this script working,, but....i.k10/19/01 15:45
Why $GLOBALS["logfile"] instead of $logfile oTrustle10/03/01 07:53
RE: emailFrank Polscheit09/18/01 10:27
RE: problem working?pavel09/14/01 09:06
Use this to log into a table:yves08/23/01 12:20
question!reza08/20/01 10:23
What log analyzer do you use?Katana07/09/01 11:24
Log AnalyzerKatana07/09/01 02:18
Thanks... but, recommend ...Jungyeon, Choe07/01/01 17:43
Generating log-file for 404Marcus Ohlsson06/19/01 07:21
RE: How to get referer URLkeykoder06/10/01 01:02
Logging Errors...JohnC06/07/01 18:36
RE: How to get referer URLAnders K. Madsen05/29/01 12:37
emailjosephine leone05/24/01 17:51
Very GoodGain05/24/01 08:24
How to get referer URLLuis Oliveira05/08/01 06:42
RE: Question about an errorPer04/21/01 18:09
RE: You should be able to calc. page output sizeEric Blade04/13/01 23:42
problem working?Conor04/09/01 11:23
Nice aricle.Dennis S.Davidoff03/15/01 08:34
RE: log file reader script???Frans03/08/01 20:04
log file reader script???John02/22/01 02:54
Thanks!Rufo01/26/01 02:32
You should be able to calc. page output sizeSkunk01/08/01 08:11
Question about an errorEagleEyes12/20/00 16:54
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.