C# Class StackExchange.Exceptional.MySQL.MySQLErrorStore

An ErrorStore implementation that uses MySQL as its backing store.
Inheritance: ErrorStore
Afficher le fichier Open project: NickCraver/StackExchange.Exceptional

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
GetConnection ( ) : MySqlConnection

Method Details

DeleteAllErrors() protected méthode

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

DeleteError() protected méthode

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
Résultat bool

DeleteErrors() protected méthode

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

GetAllErrors() protected méthode

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

GetError() protected méthode

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
Résultat Error

GetErrorCount() protected méthode

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
Résultat int

HardDeleteError() protected méthode

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
Résultat bool

LogError() protected méthode

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
Résultat void

MySQLErrorStore() public méthode

Creates a new instance of SQLErrorStore with the given configuration.
public MySQLErrorStore ( ErrorStoreSettings settings ) : System
settings ErrorStoreSettings
Résultat System

MySQLErrorStore() public méthode

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 ///
Résultat System

ProtectError() protected méthode

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
Résultat bool

ProtectErrors() protected méthode

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
Résultat bool