Class WebRequestLog

This class provides the ability to log every request into a SQL Server table. It's best called of the Application_BeginRequest EndRequest events in global.asax.

All methods of this object are static and require a connection string to the database as the first parameter.

Namespace: Westwind.Tools
Inherits: Object

Class Members

MemberDescription

Tablename

Contains the name of the table that is logged against. Note this field is static.

ClearLog

Clear the log completely.

public static Boolean ClearLog(String ConnectionString)

public static Boolean ClearLog(String ConnectionString, DateTime ClearUntilTime)

CreateTable

Creates the Request Log table in the database including the indexes required. If the table exists already it is removed and recreated.

o.CreateTable(ConnectionString)

GetLogCount

Returns a count of how many entires there are in the log.

public static Int32 GetLogCount(String ConnectionString)

LogCustomMessage

Logs a custom message type to the log file. Custom messages can be used to log errors and application events (starting/stopping) and any other operation that might require attention.

o.LogCustomMessage(ConnectionString,Type,CustomMessage)

RetrieveApplicationMessages

Retrieves all the Application Messages from the Request Log File.

o.RetrieveApplicationMessages(string ConnectionString)

RetrieveErrors

Retrieves all the errors from the Error Log file.

o.RetrieveErrors(string ConnectionString)

RetrieveLogTable

Returns the entire log as a DataTable.

public static DataTable RetrieveLogTable(String ConnectionString)

public static DataTable RetrieveLogTable(String ConnectionString, Int32 LastRecordCountToReturn)

public static DataTable RetrieveLogTable(String ConnectionString, DateTime RetrievalStartDate)


© West Wind Technologies, 1996-2018 • Updated: 10/08/03
Comment or report problem with topic