Class SqlLogAdapter

Log adapter that writes to a SQL Server Database

System.Object
  Westwind.Utilities.Logging.SqlLogAdapter
public class SqlLogAdapter : object, ILogAdapter

Class Members

MemberDescription

Constructor

Must pass in a SQL Server connection string or config ConnectionString Id.

STR_ApplicationWebLogCreateStatement

Clear

Clears all the records of the log table

public sealed bool Clear()

public sealed bool Clear(int countToLeave)

public sealed bool Clear(decimal daysToDelete)

CreateLog

Creates a new log table in the current database. If the table exists already it is dropped and recreated.

Requires database admin access.

public sealed bool CreateLog()

DeleteLog

Deletes the Sql Log Table

public sealed bool DeleteLog()

GetEntries

Returns entries for a given error level, and date range

public sealed IDataReader GetEntries(ErrorLevels errorLevel,     int count,     DateTime? dateFrom,     DateTime? dateTo,     string fieldList)

GetEntry

Returns an individual Web log entry from the log table

public sealed WebLogEntry GetEntry(int id)

GetEntryCount

Returns the number of total log entries

public sealed int GetEntryCount(ErrorLevels errorLevel)

GetEntryList

public sealed IEnumerable GetEntryList(ErrorLevels errorLevel,     int count,     DateTime? dateFrom,     DateTime? dateTo,     string fieldList)

WriteEntry

Writes a new Web specific entry into the log file

Assumes that your log file is set up to be a Web Log file

public sealed bool WriteEntry(WebLogEntry entry)

ConnectionString

LogFilename

The name of the table that data in SQL Server is written to

Requirements

Namespace: Westwind.Utilities.Logging
Assembly: westwind.utilities.dll

© West Wind Technologies, 2019 • Updated: 06/23/19
Comment or report problem with topic