|
Creating Your Own Log Files
Mattias Nilsson
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? | Peter | 08/24/07 04:51 |
| Java to php | Sunny | 12/14/05 09:47 |
| RE: how get book in pdf for PHP | Wes | 05/12/05 00:57 |
| RE: HELP! | Wes | 05/12/05 00:55 |
| which tool i can use a log file | Deepak Se | 12/06/04 09:44 |
| help! | miaka | 11/12/02 05:20 |
| RE: email | Swetha Balla | 10/28/02 23:46 |
| what is php | abialsh | 09/18/02 04:04 |
| HELP! | Nikki Tavasoli | 09/06/02 20:33 |
| which tool i can use a log file | someone | 09/06/02 18:56 |
| Can I use PHPt o develop tools for internet M | RUTAYISIRE PATRICK | 07/31/02 11:40 |
| how get book in pdf for PHP | eli | 07/09/02 15:35 |
| Simple Logging?? | Chris McCarty | 06/07/02 17:36 |
| RE: problem working? | Catherine | 05/17/02 16:29 |
| RE: Use this to log into a table: | Catherine | 05/17/02 16:27 |
| To view log file in web | prasad | 04/09/02 08:04 |
| ? How to get this working....? | Sili | 03/15/02 11:29 |
| to view log file in web | rosli | 03/09/02 00:14 |
| RE: I have got this script working,, but.... | mika | 02/02/02 09:34 |
| Uploading php file | Vishal | 01/16/02 11:57 |
| RE: can anyboday tell me how to make a login | Joshua | 01/12/02 20:48 |
| RE: can anyboday tell me how to make a login | Maresal | 01/01/02 17:44 |
| how to create set up files | kiran | 12/11/01 06:33 |
| can anyboday tell me how to make a login | fernanciso | 10/30/01 04:00 |
| I have got this script working,, but.... | i.k | 10/19/01 15:45 |
| Why $GLOBALS["logfile"] instead of $logfile o | Trustle | 10/03/01 07:53 |
| RE: email | Frank Polscheit | 09/18/01 10:27 |
| RE: problem working? | pavel | 09/14/01 09:06 |
| Use this to log into a table: | yves | 08/23/01 12:20 |
| question! | reza | 08/20/01 10:23 |
| What log analyzer do you use? | Katana | 07/09/01 11:24 |
| Log Analyzer | Katana | 07/09/01 02:18 |
| Thanks... but, recommend ... | Jungyeon, Choe | 07/01/01 17:43 |
| Generating log-file for 404 | Marcus Ohlsson | 06/19/01 07:21 |
| RE: How to get referer URL | keykoder | 06/10/01 01:02 |
| Logging Errors... | JohnC | 06/07/01 18:36 |
| RE: How to get referer URL | Anders K. Madsen | 05/29/01 12:37 |
| josephine leone | 05/24/01 17:51 | |
| Very Good | Gain | 05/24/01 08:24 |
| How to get referer URL | Luis Oliveira | 05/08/01 06:42 |
| RE: Question about an error | Per | 04/21/01 18:09 |
| RE: You should be able to calc. page output size | Eric Blade | 04/13/01 23:42 |
| problem working? | Conor | 04/09/01 11:23 |
| Nice aricle. | Dennis S.Davidoff | 03/15/01 08:34 |
| RE: log file reader script??? | Frans | 03/08/01 20:04 |
| log file reader script??? | John | 02/22/01 02:54 |
| Thanks! | Rufo | 01/26/01 02:32 |
| You should be able to calc. page output size | Skunk | 01/08/01 08:11 |
| Question about an error | EagleEyes | 12/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. | ||


