Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=130200009

ASP Server Component, Pre-made Function, Logging Utility Component

 ASP Server Components

Some of the ASP server components are the common features found in dynamic web pages. These base ASP server components are provided to enrich the pre-made functions of ASP technology for making dynamic and interactive web pages. However, some IIS pre-made components are not installed for all version of IIS. Ad Rotator, Browser Capabilities, Content Linker, Content Rotator, Counters, Logging Utility, My Info, Page Counter, Status, and tools are not installed with IIS 6.0. However, if you upgrade your Web server from a previous version of IIS, the pre-made components are not removed. Some IIS pre-made components, ASP content rotator and nextlink,  are deprecated in IIS7. And most IIS pre-made components are either not installed with IIS7 or their usage is not supported.

Logging Utility Component

The Logging Utility Component can be used to create an IISLog object that acts as a HTML tags holder on an ASP page for reading entries from the IIS log on a web page. The IISLog object provide the needed tools to open, close, check end of record and add read filter of an IISLog for reading and writing a log record to the IIS log. Besides, a specific information can also be retrieved by specifying the corresponding properties of the IISLog object accordingly. In other words, the IISLog,OpenLogFile method should be used to specify from which the IIS log file to be retrieved. Then, the appropriate log records can be read by the IISLog, the IISLog,ReadLogRecord method. And the properties of the IISLog object can be used to retrieve the required information from the log records.

Therefore an IISLog object can be used in an ASP page to extract information from the IISLog file. However, only an Administrator or Operator on the server on which the IIS is running is authenticated to instantiate the Logging Utility component when accessing the ASP script. If the user is only Anonymous, the Logging Utility component will not function properly.

The built-in Logging Utility Component can only support the four built-in logging modules that come with IIS web server. Therefore only log files created by the four built-in logging modules can be accessed through the IISLog,ReadLogRecord method of the built-in Logging Utility Component. If the log file is created by custom or third-party logging module, the built-in Logging Utility Component should be enhanced before the IISLog,ReadLogRecord method can read the record in the log file created by the custom or third-party logging module. 

File Name

The file name of the Content Rotator component is Logscrpt.dll.

Syntax

Set IISLogName = Server.CreateObject( "MSWC.IISLog" )

Parameters

IISLogName

The parameter "IISLogName" is the name assigned to the instance of the IISLog object created by the call using the Server.CreateObject.

Remark

The Content Rotator component does not work with Internet Information Server 7 (IIS7).

IISLog.AtEndOfLog Method

IISLog.AtEndOfLog method is used to check whether there are any more reacords available in the IIS log file by attempting to read a log record from the IIS log file specified by the IISLog.OpenLogFile method. The IISLog.AtEndOfLog method returns TRUE when an attempt to read past the end of the  IIS log file.

Syntax Syntax

IISLogName.AtEndOfLog()

Parameters

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return Values by this method contains an boolean data.  IISLog.AtEndOfLog method returns "TRUE" only if there is no more record can be read from the IIS log file. Otherwise, IISLog.AtEndOfLog method will return "FALSE"

IISLog.CloseLogFiles Method

IISLog.CloseLogFiles method is used to close all opened IIS log files which are opened by the IISLog object using the IISLog.OpenLogFile method according to the specified IOMode parameter.

Syntax Syntax

IISLogName.CloseLogFiles(IOMode)

Parameters

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

IOMode

The parameter "IOMode" is a "Long" type value used to specify which types of log file or files to be closed by the IISLog.CloseLogFiles method. The possible values are:

Value=1: Constant name "ForReading" is used to indicate that all log files that have been opened for reading by IISLog object should be closed
Value=2: Constant name "ForWriting" is used to indicate that all log files that have been opened for writing by IISLog object should be closed
Value=32: Constant name "AllOpenFiles" is used to indicate that all log files that have been opened by IISLog object should be closed

IISLog.OpenLogFile Method

IISLog.OpenLogFile method is used to open the specified log file for reading or writing by IISLog object. In order to return the correct log file for log file manipulation by the IISLog object, none of the parameters of the IISLog.OpenLogFile method are optional

Syntax Syntax

IISLogName.OpenLogFile(
        FileName,IOMode,ServiceName,ServiceInstance,OutputLogFileFormat)

Parameters

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

FileName

The parameter "FileName" is the name of the log file to be opened by the IISLog.OpenLogFile method.

IOMode

The parameter "IOMode" is used to specify whether the log file to be opened by the IISLog.OpenLogFile method is opened for reading or writing. The possible values are:

Value=1: Constant name "ForReading" is used to indicate that the log file  to be opened by the IISLog.OpenLogFile method is opened for reading by IISLog object only
Value=2: Constant name "ForWriting" is used to indicate that all log files to be opened by the IISLog.OpenLogFile method is opened  for writing by IISLog object only

ServiceName

The parameter "ServiceName" is used to specify the service name of the logging module which is used to create the log file that is used for log file manipulation by the IISLog object. Only the matched log file created by the specified logging module will return records by the IISLog object.

ServiceInstanceviceInstance

The parameter "ServiceInstance" is used to specify the specific instance of the named service of the logging module which is used to create the log file that is used for log file manipulation by the IISLog object. Only the matched log file created by the specified named service of the logging module will return records by the IISLog object.

OutputLogFileFormat

The parameter "OutputLogFileFormat" is used to specify the format of the matched log file that is used for log file manipulation by the IISLog object.

IISLog.ReadFilter Method

IISLog.ReadFilter method is used to specify the constraint in terms of a date and time range filter for reading log records from the log file for log file manipulation by the IISLog object. Although bothe the "startDateTime" and "endDateTime" are optional parameters, at least one parameter should be specified.

Syntax Syntax

IISLogName.ReadFilter([startDateTime],[endDateTime])

Parameters

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

startDateTime

The optional parameter "startDateTime" is used to specify the date and time after which log records are to be read.

endDateTime

The optional parameter "endDateTime" is used to specify the date and time before which log records are to be read.

IISLog.ReadLogRecord Method

IISLog.ReadLogRecord method is used to read the next available log record from the log file for log file manipulation by the IISLog object.

Syntax

IISLogName.ReadLogRecord()

Parameters

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

IISLog.WriteLogRecord Method

IISLog.WriteLogRecord method is used to write the new log record read from another the log file using another IISLog object to the opened log file by the IISLog object.

Syntax

IISLogName.WriteLogRecord(IISLogReadName)

Parameters

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to which the log record is written.

IISLogReadName

The parameter "IISLogReadName" is the name of the instance of the IISLog object from which the log record is read.

 

IISLog.BytesReceived Property

IISLog.BytesReceived property is used to retrieve the number of bytes received during the operation from the current log record read by the IISLog object.

Syntax

count=IISLogName.BytesReceived

Parameters

count

The parameter "count" is the number of bytes received field from the current log record assigned to.

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.BytesSent Property

IISLog.BytesSent property is used to retrieve the number of bytes sent during the operation from the current log record read by the IISLog object.

Syntax

count=IISLogName.BytesSent

Parameters

count

The parameter "count" is the number of bytes sent field from the current log record assigned to.

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.ClientIP Property

IISLog.ClientIP property is used to retrieve the client's IP address for the operation from the current log record read by the IISLog object.

Syntax

var=IISLogName.ClientIP

Parameters

var

The parameter "var" is the client's IP address field from the current log record  assigned to.

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.Cookie Property

IISLog.Cookie property is used to retrieve the client's cookie for the operation from the current log record read by the IISLog object.

Syntax

var=IISLogName.Cookie

Parameters

var

The parameter "var" is the cookie field from the current log record  assigned to.

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.CustomFields Property

IISLog.CustomFields property is used to extract the customfields for the operation from the current log record read by the IISLog object. The IISLog.CustomFields property enable the IISLog object to retrieve any custom or special fields, such as extra custom HTTP headers included in the HTTP operation that were logged by IIS

Syntax

var=IISLogName.CustomFields

Parameters

var

The parameter "var" is a two-dimensional array of variants to which each pair of variants in form of a paired key-value to describle an HTTP header in the CustomFields field extracted from the current log record  assigned.

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.DateTime Property

IISLog.DateTime property is used to retrieve the date and time in GMT of the operation from the current log record read by the IISLog object.

Syntax

var=IISLogName.DateTime

Parameters

var

The parameter "var" is the data and time field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.Method Property

IISLog.Method property is used to extract the HTTP operation type from the current log record read by the IISLog object.

Syntax

var=IISLogName.Method

Parameters

var

The parameter "var" is the HTTP operation type such as GET or PUT extracted of the Method field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.ProtocolStatus Property

IISLog.ProtocolStatus property is used to retrieve the HTTP protocol status code for the HTTP operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.ProtocolStatus

Parameters

var

The parameter "var" is the ProtocolStatus field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.ProtocolVersion Property

IISLog.ProtocolVersion property is used to retrieve the ProtocolVersion string from the current log record read by the IISLog object.

Syntax

var=IISLogName.ProtocolVersion

Parameters

var

The parameter "var" is the ProtocolVersion field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.Referer Property

IISLog.Referer property is used to retrieve the referer URL from the current log record read by the IISLog object.

Syntax

var=IISLogName.Referer

Parameters

var

The parameter "var" is the Referer field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.ServerIP Property

IISLog.ServerIP property is used to retrieve the server's IP address for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.ServerIP

Parameters

var

The parameter "var" is the IP address of the server in the ServerIP field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.ServerName Property

IISLog.ServerName property is used to retrieve the  name of the computer for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.ServerName

Parameters

var

The parameter "var" is the name of the computer in the ServerName field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.ServerPort Property

IISLog.ServerPort property is used to retrieve the port number used for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.ServerPort

Parameters

var

The parameter "var" is the port number used for the operation in the ServerPort field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.ServiceName Property

IISLog.ServiceName property is used to retrieve the name of service including the server instance from the current log record read by the IISLog object.

Syntax

var=IISLogName.ServiceName

Parameters

var

The parameter "var" is the ServiceName field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.TimeTaken Property

IISLog.TimeTaken property is used to retrieve the total processing time required for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.TimeTaken

Parameters

var

The parameter "var" is the TimeTaken field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.URIQuery Property

IISLog.URIQuery property is used to retrieve any HTTP request parameters or query string that was passed for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.URIQuery

Parameters

var

The parameter "var" is the URIQuery field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.URIStem Property

IISLog.URIStem property is used to retrieve the target URL for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.URIStem

Parameters

var

The parameter "var" is the URIStem field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.UserAgent Property

IISLog.UserAgent property is used to retrieve the browser user agent string for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.UserAgent

Parameters

var

The parameter "var" is the UserAgent field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.UserName Property

IISLog.UserName property is used to retrieve the user name of non-anonymous client for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.UserName

Parameters

var

The parameter "var" is the UserName field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

IISLog.Win32Status Property

IISLog.Win32Status property is used to retrieve the Win32 status code for the operation referred to from the current log record read by the IISLog object.

Syntax

var=IISLogName.Win32Status

Parameters

var

The parameter "var" is the Win32Status field from the current log record assigned to

IISLogName

The parameter "IISLogName" is the name of the instance of the IISLog object to be set.

Return Values

Return values only available when the property is configured to log the specified property on the  Web server in the log files.

Previous Month  FEB  2013  Next Month
SMTWTFS
12
3456789
10111213141516
17181920212223
2425262728

Previous Month  SEP  2016  Next Month
SMTWTFS
123
45678910
11121314151617
18192021222324
252627282930

Sideway BICK Blog

16/02


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013