#22003/2/19 9:31:51
真巧,小田这2天正在做IIS Log 分析,写了一个COM,你可以使用微软提供的MSWC.IISLog,可以取得所有的IIS记录。下面是方法和属性:
The MSWC logging utility
When Windows 2000 server is installed for the first time, a DLL named “logscrpt.dll” is also installed and registered. This DLL contains the MSWC.IISLog class, which allows us to load, read, write and close IIS log files on our server. To create an instance of the MSWC.IISLog class in ASP, we use the “MSWC.IISLog” ProgId, like this:
set objLog = Server.CreateObject("MSWC.IISLog")
The MSWC.IISLog class contains several methods and properties that can be used to either retrieve log entries, or write log entries to a log file. These methods and properties are described below:
Methods
AtEndOfLog: Indicates whether all records have been read from the log file.
CloseLogFiles: Closes all open log files.
OpenLogfile: Opens a log file for reading or writing.
ReadFilter: Filters records from the log file by date and time.
ReadLogRecord: Reads the next available log record from the current log file.
WriteLogRecord: Writes a log record to the current log file.
Properties
BytesReceived: Indicates the number of bytes received.
BytesSent: Indicates the number of bytes sent.
ClientIP: Indicates the client’s host name.
Cookie: Indicates the client’s cookie.
CustomFields: Indicates an array of custom headers.
DateTime: Indicates the date and time, in GMT.
Method: Indicates the operation type.
ProtocolStatus: Indicates the protocol status.
ProtocolVersion: Indicates the version string.
Referer: Indicates the referrer page.
ServerIP: Indicates the server’s IP address.
ServerName: Indicates the server name.
ServerPort: Indicates the port number.
ServiceName: Indicates the service name.
TimeTaken: Indicates the total processing time.
URIQuery: Indicates any parameters passed with the request.
URIStem: Indicates the target URL.
UserAgent: Indicates the user agent string.
UserName: Indicates the user’s name.
Win32Status: Indicates the Win32 status code.