IHttpTraceContext::QuickTrace Method

IIS 7.0
 

Writes a message to the IIS trace log.

virtual
    HRESULT
    QuickTrace(
        IN PCWSTR   pszData1,
        IN PCWSTR   pszData2 = NULL,
        IN HRESULT  hrLastError = S_OK,
        IN UCHAR    Level = 4
    ) = 0;

Parameter

Description

pszData1

A message to log.

pszData2

A second message to log.

hrLastError

The HRESULT to log. The default is S_OK.

level

The trace level. The possible values are 1 through 7. The default is 4 (TRACE_LEVEL_INFORMATION). For more information, see the Remarks section.

An HRESULT. Possible values include, but are not limited to, those in the following table.

Value

Description

S_OK

Indicates that the operation was successful.

Event trace levels 1 through 5 correspond to Event Tracing for Windows (ETW) trace levels. For more information about these trace levels, see the EVENT_TRACE_HEADER structure. You can also use trace level 6 (defined as HTTP_TRACE_LEVEL_START in the Httptrace.h header file) and trace level 7 (defined as HTTP_TRACE_LEVEL_END in Httptrace.h).

Example

The following example demonstrates how to use the IHttpRequest::SetUrl method to change a requested URL to another URL and log the change with the QuickTrace method.

You must enable Failed Event Request tracing to see the event.

Requirements

Type

Description

Client

  • IIS 7.0 on Windows Vista

  • IIS 7.5 on Windows 7

  • IIS 8.0 on Windows 8

  • IIS 10.0 on Windows 10

Server

  • IIS 7.0 on Windows Server 2008

  • IIS 7.5 on Windows Server 2008 R2

  • IIS 8.0 on Windows Server 2012

  • IIS 8.5 on Windows Server 2012 R2

  • IIS 10.0 on Windows Server 2016 Technical Preview

Product

  • IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0

  • IIS Express 7.5, IIS Express 8.0, IIS Express 10.0

Header

Httpserv.h

Show: