Table of Contents

Class FileAppender.InterProcessLock

Namespace
log4net.Appender
Assembly
log4net.dll

Provides cross-process file locking.

public class FileAppender.InterProcessLock : FileAppender.LockingModelBase
Inheritance
FileAppender.InterProcessLock
Inherited Members

Constructors

InterProcessLock()

public InterProcessLock()

Methods

AcquireLock()

Acquire the lock on the file

public override Stream AcquireLock()

Returns

Stream

A stream that is ready to be written to.

Remarks

Does nothing. The lock is already taken

CloseFile()

Close the file

public override void CloseFile()

Remarks

Close the file. No further writes will be made.

OpenFile(string, bool, Encoding)

Open the file specified and prepare for logging.

public override void OpenFile(string filename, bool append, Encoding encoding)

Parameters

filename string

The filename to use

append bool

Whether to append to the file, or overwrite

encoding Encoding

The encoding to use

Remarks

Open the file specified and prepare for logging. No writes will be made until AcquireLock() is called. Must be called before any calls to AcquireLock(), -ReleaseLock() and CloseFile().

ReleaseLock()

public override void ReleaseLock()