Class WebRequestLog

This class provides the ability to log requests into a SQL Server table. It's best called of the Application_BeginRequest/EndRequest event in global.asax. It can optionally log a request duration.

System.Object
  Westwind.Tools.WebRequestLog

public class WebRequestLog : object

Class Members

MemberDescription
Constructor
Tablename
ClearLog Clear the log completely.
public static bool ClearLog( string ConnectionString );

public static bool ClearLog( string ConnectionString,
DateTime ClearUntilTime );

CreateLogTable Creates the Table that receives log requests. Must pass a valid connection string to the database that will be receive these log requests.
public static bool CreateLogTable( string ConnectionString );
GetLogCount Returns a count of how many entires there are in the log.
public static int GetLogCount( string ConnectionString );
Log Parses the Exception into properties of this object. Called internally by LogError, but can also be called externally to get easier information about the error through the property interface.
public static bool Log( string ConnectionString,
bool CompactFormat,
DateTime StartTime );
LogCustomMessage Logs a custom message. Use for logging errors application messages and anything else you need to customize
public static bool LogCustomMessage( string ConnectionString,
WebRequestLogMessageTypes Type,
string CustomMessage );
Retrieve24HourSummary Returns a two column summary table that shows Hour of day and hits for the last 24 hour period. Field names are Hits (int), Day (int), Hour (int), Day (int) and AvgTime (float) sorted by day, hour
public static DataTable Retrieve24HourSummary( string ConnectionString );
RetrieveApplicationMessages Returns all Application Messages
public static DataTable RetrieveApplicationMessages( string ConnectionString );
RetrieveErrors Returns all Errors in the file
public static DataTable RetrieveErrors( string ConnectionString );
RetrieveLogTable Returns the entire log table. All Types, all dates...
public static DataTable RetrieveLogTable( string ConnectionString );

public static DataTable RetrieveLogTable( string ConnectionString,
int MaxRecordsToReturn );

public static DataTable RetrieveLogTable( string ConnectionString,
DateTime RetrievalStartDate );

Requirements

Namespace: Westwind.Tools
Assembly: westwind.tools.dll


 Last Updated: 1/15/2007 | Send topic feedback