| title | IHttpTraceContext::QuickTrace Method |
|---|---|
| description | Describes the IHttpTraceContext::QuickTrace method and details its syntax, parameters, return value, remarks, code example, and requirements. |
| ms.date | 10/07/2016 |
| ms.assetid | a0d43e55-a773-4f55-ae09-33b451adfe4b |
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).
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.
[!code-cpp_GPR#1]
[!code-cpp_GPR#1]
[!code-cpp_GPR#2]
[!code-cppIHttpRequestSetHttpMethod#1]
| Type | Description |
|---|---|
| Client | - IIS 7.0 on [!INCLUDEwinvista] - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
| Server | - IIS 7.0 on [!INCLUDEwinsrv2008] - 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 |
| Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 - [!INCLUDEiisexp75], [!INCLUDEiisexp80], [!INCLUDEiisexp100] |
| Header | Httpserv.h |