Class FileAppender.InterProcessLock
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
filenamestringThe filename to use
appendboolWhether to append to the file, or overwrite
encodingEncodingThe 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()