C# 클래스 StackExchange.Exceptional.MySQL.MySQLErrorStore

An ErrorStore implementation that uses MySQL as its backing store.
상속: ErrorStore
파일 보기 프로젝트 열기: NickCraver/StackExchange.Exceptional

공개 메소드들

메소드 설명
MySQLErrorStore ( ErrorStoreSettings settings ) : System

Creates a new instance of SQLErrorStore with the given configuration.

MySQLErrorStore ( string connectionString, int displayCount = DefaultDisplayCount, int rollupSeconds = DefaultRollupSeconds ) : System

Creates a new instance of SQLErrorStore with the specified connection string.

보호된 메소드들

메소드 설명
DeleteAllErrors ( string applicationName = null ) : bool

Deleted all errors in the log, by setting DeletionDate = UTC_DATE() in SQL

DeleteError ( System.Guid guid ) : bool

Deletes an error, by setting DeletionDate = UTC_DATE() in SQL

DeleteErrors ( IEnumerable guids ) : bool

Deletes errors, by setting DeletionDate = UTC_DATE() in SQL

GetAllErrors ( List errors, string applicationName = null ) : int

Retrieves all non-deleted application errors in the database

GetError ( System.Guid guid ) : Error

Gets the error with the specified guid from SQL This can return a deleted error as well, there's no filter based on DeletionDate

GetErrorCount ( System.DateTime since = null, string applicationName = null ) : int

Retrieves a count of application errors since the specified date, or all time if null

HardDeleteError ( System.Guid guid ) : bool

Hard deletes an error, actually deletes the row from SQL rather than setting DeletionDate This is used to cleanup when testing the error store when attempting to come out of retry/failover mode after losing connection to SQL

LogError ( Error error ) : void

Logs the error to SQL If the rollup conditions are met, then the matching error will have a DuplicateCount += @DuplicateCount (usually 1, unless in retry) rather than a distinct new row for the error

ProtectError ( Guid guid ) : bool

Protects an error from deletion, by making IsProtected = 1 in the database

ProtectErrors ( IEnumerable guids ) : bool

Protects errors from deletion, by making IsProtected = 1 in the database

비공개 메소드들

메소드 설명
GetConnection ( ) : MySqlConnection

메소드 상세

DeleteAllErrors() 보호된 메소드

Deleted all errors in the log, by setting DeletionDate = UTC_DATE() in SQL
protected DeleteAllErrors ( string applicationName = null ) : bool
applicationName string
리턴 bool

DeleteError() 보호된 메소드

Deletes an error, by setting DeletionDate = UTC_DATE() in SQL
protected DeleteError ( System.Guid guid ) : bool
guid System.Guid The guid of the error to delete
리턴 bool

DeleteErrors() 보호된 메소드

Deletes errors, by setting DeletionDate = UTC_DATE() in SQL
protected DeleteErrors ( IEnumerable guids ) : bool
guids IEnumerable The guids of the error to delete
리턴 bool

GetAllErrors() 보호된 메소드

Retrieves all non-deleted application errors in the database
protected GetAllErrors ( List errors, string applicationName = null ) : int
errors List
applicationName string
리턴 int

GetError() 보호된 메소드

Gets the error with the specified guid from SQL This can return a deleted error as well, there's no filter based on DeletionDate
protected GetError ( System.Guid guid ) : Error
guid System.Guid The guid of the error to retrieve
리턴 Error

GetErrorCount() 보호된 메소드

Retrieves a count of application errors since the specified date, or all time if null
protected GetErrorCount ( System.DateTime since = null, string applicationName = null ) : int
since System.DateTime
applicationName string
리턴 int

HardDeleteError() 보호된 메소드

Hard deletes an error, actually deletes the row from SQL rather than setting DeletionDate This is used to cleanup when testing the error store when attempting to come out of retry/failover mode after losing connection to SQL
protected HardDeleteError ( System.Guid guid ) : bool
guid System.Guid The guid of the error to hard delete
리턴 bool

LogError() 보호된 메소드

Logs the error to SQL If the rollup conditions are met, then the matching error will have a DuplicateCount += @DuplicateCount (usually 1, unless in retry) rather than a distinct new row for the error
protected LogError ( Error error ) : void
error Error The error to log
리턴 void

MySQLErrorStore() 공개 메소드

Creates a new instance of SQLErrorStore with the given configuration.
public MySQLErrorStore ( ErrorStoreSettings settings ) : System
settings ErrorStoreSettings
리턴 System

MySQLErrorStore() 공개 메소드

Creates a new instance of SQLErrorStore with the specified connection string.
public MySQLErrorStore ( string connectionString, int displayCount = DefaultDisplayCount, int rollupSeconds = DefaultRollupSeconds ) : System
connectionString string The database connection string to use
displayCount int /// How many errors to display in the log (for display ONLY, the log is not truncated to this /// value) ///
rollupSeconds int /// The rollup seconds, defaults to , duplicate /// errors within this time period will be rolled up ///
리턴 System

ProtectError() 보호된 메소드

Protects an error from deletion, by making IsProtected = 1 in the database
protected ProtectError ( Guid guid ) : bool
guid Guid The guid of the error to protect
리턴 bool

ProtectErrors() 보호된 메소드

Protects errors from deletion, by making IsProtected = 1 in the database
protected ProtectErrors ( IEnumerable guids ) : bool
guids IEnumerable The guids of the error to protect
리턴 bool