If you want enable other applications to read your custom logging module's log records, then you must implement the ILogScripting interface. If this interface is exposed by your module, applications can use the LogScripting object, created using the Logging Utility, to call the methods provided by ILogScripting.
Note IIS itself will not call any of the member methods of ILogScripting interface.
Your interface should be designed and implemented to handle only one log file query session per module instance. Therefore, each call to ILogScripting::SetInputLogFile and ILogScripting::SetInputServerInstance should reset the record read state.
Important Note that, unlike the ILogPlugin and ILogUIPlugin COM interfaces implemented by your custom logging module, the ILogScripting interface is an Automation interface, and inherits from IDispatch instead of directly from IUnknown. Support for Automation data types and other basic Automation features must be provided by your custom logging module for ILogScripting to function properly.
The following methods are defined by the ILogScripting interface, and allow the caller to control what log records your custom logging module is reading.
Method | Description |
ILogScripting::CloseLogFiles | Closes all log files |
ILogScripting::ReadLogRecord | Reads the next available log record |
ILogScripting::SetInputLogFile | Sets the log file to be read |
ILogScripting::SetInputServerInstance | Specifies which server's log files should be read |
ILogScripting::SetOutputFile | Sets the log file to which log records should be written |
ILogScripting::WriteLogRecord | Writes a log record to the log file |
Once the caller has used the methods described above to gain access to a particular log record, the following methods should become functional. These methods, implemented by your custom logging module, enable the caller to retrieve specific types of information from the log record.
Method | Description |
ILogScripting::GetBytesRecvd | Retrieves the number of bytes received |
ILogScripting::GetBytesSent | Retrieves the number of bytes sent |
ILogScripting::GetClientHostName | Retrieves the client's host name |
ILogScripting::GetClientUserName | Retrieves the user's name |
ILogScripting::GetComputerName | Retrieves the computer name |
ILogScripting::GetCustomFields | Retrieves the custom fields |
ILogScripting::GetDateTime | Retrieves the date and time |
ILogScripting::GetOperation | Retrieves the HTTP operation type |
ILogScripting::GetParameters | Retrieves any parameters passed as part of the HTTP request |
ILogScripting::GetPortNumber | Retrieves the port number |
ILogScripting::GetProtocolStatus | Retrieves the HTTP protocol status code |
ILogScripting::GetServerAddress | Retrieves the server's IP address |
ILogScripting::GetSiteName | Retrieves the service name and server instance |
ILogScripting::GetTarget | Retrieves the target string for the HTTP request |
ILogScripting::GetTimeForProcessing | Retrieves the total processing time |
ILogScripting::GetVersionString | Retrieves the version string |
ILogScripting::GetWin32Status | Retrieves the Win32 status code |
Note The LogScripting also implements the ILogScripting interface. However, the Logging Utility component is used to transparently read log records, regardless of what logging module actually created the log record. Therefore, the methods implemented by the Logging Utility component provide functionality that will not be required of your ILogScripting interface.
All interface, function, and data structure definitions are provided in the header file ilogobj.h and logtype.h. Both header files must be included.