Name
AppendToLog —
Response.AppendToLog
strLogEntry
Synopsis
Adds a string to the web server log entry for the current client request. You can only add up to 80 characters at a time, but you are able to call the AppendToLog method multiple times.
Logging web site activity
IIS allows you to log user activity into a text file[2] or into an ODBC-compliant database. This logging is separate from Windows NT logging, and the records in the IIS log cannot be viewed using the Windows NT Event Viewer tool. To view the IIS log files, you must open them as you would any other ASCII text file, import them into a spreadsheet or database program, or, if you've been logging to an ODBC database, view them through queries to that database.
Specifically, you can log the following aspects of users' visits to your web site, among other things:
Date/time of user visit
Requested pages
IP address of user
Length of time connected to server
Using this information and information your application adds to this log through Response.AppendToLog, you can plan future development for your site, plan security, and plan for new servers if the load warrants it.
Parameters
-
strLogEntry The string you want added to the current client request's entry in the web server. This string can be up to 80 characters in length. Note that the string you append to the web server log entry cannot contain commas, since the fields in the IIS web log entries are comma delimited.
Example
<% ' Assume you have constructed one string containing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access