in reply to Poor Man's Web Logger
After talking to someone else I found out that our(I work for a *non-profit ISP)system isn't normal. It was intentionally setup this way so users wouldn't crowd our lowly disk space with logs. It also keeps people from wanting to run Mom and Pop webstores. It took some tweaking but it works now. The data is also formatted to look like an apache logfile. That way it is much easier to parse the logfile. I'm very appreciative of the program. Notice that it plays nice for Daylight Savings Time (I'm in the central time zone).
I didn't personally make the changes. A friend did.
At the time it was quicker for him to make the changes
and for me to figure it out later than for me to break
his train of thought as he taught me. :)
* Not a non-profit "like" ISP. But a real Free-Net.
Changes were made here:
my %entries = ('home' => '/index.html$|/$');
And here:
my $zulu_offset = $isdst ? "-0500" : "-0600"; my $date = "[$mday/$month/$year:$hour:$min:$sec $zulu_offset]"; unless ($ENV{REMOTE_ADDR} =~ /^$ips/) { my $hostname; $hostname = gethostbyaddr(inet_aton($ENV{REMOTE_ADDR}), AF_INE +T) or $hostname = $ENV{REMOTE_ADDR}; my $data = "$hostname - - $date"; open LOG, ">>$logfile" or last; flock LOG, 2; foreach (keys %entries) { print LOG "$data $_\n" if ($ENV{HTTP_REFERER} =~ /$entries{$ +_}/); } close LOG; }
|
|---|