Export (0) Print
Expand All

HttpResponse.AppendToLog Method

Adds custom log information to the Internet Information Services (IIS) log file.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

[AspNetHostingPermissionAttribute(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Medium)]
public void AppendToLog(
	string param
)

Parameters

param
Type: System.String

The text to add to the log file.

To allow for the specified string to be recorded in the log file, you first must enable the URI Query option of the Extended Logging Properties dialog box for the site that you want to log activity for in IIS.

To customize extended logging in IIS 6.0, follow these steps:

  1. In IIS Manager, expand the local computer node, expand the Web or FTP Sites folder, right-click the Web or FTP site, and then click Properties.

  2. Click the Web or FTPSite tab, and then select the Enable logging check box (if it is not already selected).

  3. In the Active log format box, click W3C Extended Log File Format.

  4. Click Properties.

  5. Click the Advanced tab, select the properties that you want to log, and then click OK.

The following example shows how to append a string to the log.

Response.AppendToLog("Page delivered");

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft