FileAppender MinimalLock Class | Apache log4net™ SDK Documentation

Acquires the file lock for each write
Inheritance Hierarchy

System
Object
log4net.Appender
FileAppender
LockingModelBase
log4net.Appender
FileAppender
MinimalLock

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

C#
VB
C++
F#
Copy

    public class MinimalLock : FileAppenderLockingModelBase

    Public Class MinimalLock
    	Inherits FileAppenderLockingModelBase

    public ref class MinimalLock : public FileAppenderLockingModelBase

    type MinimalLock =
        class
            inherit FileAppenderLockingModelBase
        end

The FileAppender
MinimalLock type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| FileAppender MinimalLock | Initializes a new instance of the FileAppender MinimalLock class

Top
Properties

| Name | Description
--- | --- | ---
| CurrentAppender | Gets or sets the FileAppender for this LockingModel (Inherited from FileAppender LockingModelBase.)

Top
Methods

| Name | Description
--- | --- | ---
| AcquireLock | Acquire the lock on the file (Overrides FileAppender LockingModelBase AcquireLock .)
| ActivateOptions | Initializes all resources used by this locking model. (Overrides FileAppender LockingModelBase ActivateOptions .)
| CloseFile | Close the file (Overrides FileAppender LockingModelBase CloseFile .)
| CloseStream | Helper method to close stream under CurrentAppender's SecurityContext. (Inherited from FileAppender LockingModelBase.)
| CreateStream | Helper method that creates a FileStream under CurrentAppender's SecurityContext. (Inherited from FileAppender LockingModelBase.)
| Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
| 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.)
| 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.)
| OnClose | Disposes all resources that were initialized by this locking model. (Overrides FileAppender LockingModelBase OnClose .)
| OpenFile | Prepares to open the file when the first message is logged. (Overrides FileAppender LockingModelBase OpenFile(String, Boolean, Encoding).)
| ReleaseLock | Release the lock on the file (Overrides FileAppender LockingModelBase ReleaseLock .)
| ToString | Returns a String that represents the current Object. (Inherited from Object.)

Top
Remarks

Opens the file once for each AcquireLock
/ReleaseLock
cycle, thus holding the lock for the minimal amount of time. This method of locking is considerably slower than FileAppender
ExclusiveLock but allows other processes to move/delete the log file whilst logging continues.

See Also

#### Reference

log4net.Appender Namespace