FileLifecycleHooks Class |
Namespace: NLog.Targets
The FileLifecycleHooks type exposes the following members.
| Name | Description | |
|---|---|---|
| FileLifecycleHooks | Initializes a new instance of the FileLifecycleHooks class |
| Name | Description | |
|---|---|---|
| OnFileClosed |
Called after a log file has been closed by the FileTarget.
| |
| OnFileDeleting |
Called immediately before a log file is deleted by the FileTarget.
| |
| OnFileOpened |
Initializes or wraps the stream opened for a log file.
This can be used to write file headers, or wrap the stream in another stream
that adds buffering, compression, encryption, etc.
| |
| OnTargetClose |
Called when the FileTarget is being closed.
| |
| OnTargetInitialize |
Called when the FileTarget is initialized.
|
A FileTarget can have multiple log files open simultaneously. File lifecycle callbacks therefore apply to the individual file identified by filePath and must not assume that there is only one active file.
The same file may be opened and closed multiple times during the lifetime of a FileTarget.