OnlyOnceErrorHandler Class | Apache log4net™ SDK Documentation

Implements log4net's default error handling policy which consists of emitting a message for the first error in an appender and ignoring all subsequent errors.
Inheritance Hierarchy

System
Object
log4net.Util
OnlyOnceErrorHandler

Namespace: log4net.Util
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public class OnlyOnceErrorHandler : IErrorHandler

    Public Class OnlyOnceErrorHandler
    	Implements IErrorHandler

    public ref class OnlyOnceErrorHandler : IErrorHandler

    type OnlyOnceErrorHandler =
        class
            interface IErrorHandler
        end

The OnlyOnceErrorHandler type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| OnlyOnceErrorHandler | Default Constructor
| OnlyOnceErrorHandler(String) | Constructor

Top
Properties

| Name | Description
--- | --- | ---
| EnabledDate | The date the first error that trigged this error handler occurred, or MinValue if it has not been triggered.
| EnabledDateUtc | The UTC date the first error that trigged this error handler occured, or MinValue if it has not been triggered.
| ErrorCode | The error code from the first error that trigged this error handler.
| ErrorMessage | The message from the first error that trigged this error handler.
| Exception | The exception from the first error that trigged this error handler.
| IsEnabled | Is error logging enabled

Top
Methods

| Name | Description
--- | --- | ---
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
| Error(String) | Log an error
| Error(String, Exception) | Log an Error
| Error(String, Exception, ErrorCode) | Log an Error
| Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
| FirstError | Log the very first error
| GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.)
| GetType | Gets the Type of the current instance. (Inherited from Object.)
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.)
| Reset | Reset the error handler back to its initial disabled state.
| ToString | Returns a String that represents the current Object. (Inherited from Object.)

Top
Remarks

The error message is processed using the LogLog sub-system by default.

This policy aims at protecting an otherwise working application from being flooded with error messages when logging fails.

See Also

#### Reference

log4net.Util Namespace