I am not sure I know the 'Best' way to log page requests but here is what we
I use the 'On Execute Start' method in the Active4D.a4l library to do two
1. Ensure that the user has logged on to the system (I check for a session
variable of 'UserName').
2. I create or update a record in a table indicating the last date/time
they requested a page. This isn't exactly a full logging but it could be
easily modified to work this way. It seems that logging every page request
would be a little excessive however.
Remember that A4D automatically handles sessions and session time-outs. The
only reason I am logging this bit of info is that one can't test the current
session information from a 4D Method. I modified the A4D shell code to
handle file downloads with some special behaviours and need this information
to ensure the user is currently authorized. In retrospect I could also have
done something like pass the session ID to the a4D Shell code and called
'A4D Get Session Stats' - I may go back and modify it later to do just
that. Always seems to be more than one way to do these things. Currently
the creation or update of the record does not seem to create any kind of
problem so I am leaving it alone.
Do you need every page logged or is it more like you need certain page hits
logged? If you only need certain page hits logged I would just create a 4D
or A4D method to create your log entry and call it at the top of the page.
For example, at the top of every one of my application pages I include an
'Application_style.a4d' file to import the style sheet for the page. It is
easy enough to do on every page - if you do something similar you should be
able to add the log code to that one location and you are good to go.
You can use 'Current File' to return the name of the currently executing
script and/or 'current path' to show the full path to the script (including
You also mentioned generating standard log files - you could reasonably do
this as well by modifying the Active4D.a4l code or the Active 4D shell code
In summary, you have a bunch of options.
----- Original Message -----
From: "Glenn Lees" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 24, 2002 8:22 PM
Subject: [Active4d-dev] Logging stuff
> Hello All,
> I'm very much a novice on web stuff, but have been using 4D for years.
> First thing to say is that Active4D is a LOT of fun! I can't believe how
> easy it makes publishing our stuff on the web.
> My question - what is the best way (if any) of logging page requests and
> on - am using ITK as the TCP component?
> Does A4D produce standard web log files, or is it easier to just use it to
> produce my own logs in the database?
> Any advice appreciated.
> Best Regards
> Glenn Lees.
> Active4d-dev mailing list
> [hidden email] > http://aparajitaworld.com/mailman/listinfo/active4d-dev >