I find the logger script, its looks enough accurate. Its simple script that keeps a log of everyone who "hits" the page, keeping the information in one file.
What I want is add one feature - logs emailing feature.
Emaling need be configurable, i.e. logfile will be emailed after "hits" exceed predefined 'hits' quantity, even after 1 hit). Emaling feature can be turned off if not required. Also, can be used txt for logfile, main.txt not .log? Excecuting script should be via image tags, not SSI. Probably ,it possible to return a location header that points to an existing image url, one pix gif. Or print image.
I was wondering if someone can help me. Its looks not difficult task..
#! /usr/local/bin/perl # logger.cgi # version 1.0 # # Create a file called main.log. Must have write permissions # set to main.log $mainlog = "main.log"; $shortdate = `date +"%D %T %Z"`; chop ($shortdate); print "Content-type: text/plain\n\n "; open (MAINLOG, ">>$mainlog"); print MAINLOG "Time: $shortdate\n"; print MAINLOG "User: $ENV{'REMOTE_IDENT'}\n"; print MAINLOG "Host: $ENV{'REMOTE_HOST'}\n"; print MAINLOG "Addr: $ENV{'REMOTE_ADDR'}\n"; print MAINLOG "With: $ENV{'HTTP_USER_AGENT'}\n"; print MAINLOG "Page: $ENV{'DOCUMENT_URI'}\n"; print MAINLOG "From: $ENV{'HTTP_REFERER'}\n\n"; close (MAINLOG); exit;

Edit by castaway - Font tags removed as they muck with themes.


In reply to logger.cgi script - implementing one feature by amalgama

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.