FileTarget Properties |
The FileTarget type exposes the following members.
Name | Description | |
---|---|---|
ArchiveAboveSize |
Gets or sets the size in bytes above which log files will be automatically archived.
| |
ArchiveDateFormat |
Gets or sets a value specifying the date format to use when archiving files.
| |
ArchiveEvery |
Gets or sets a value indicating whether to automatically archive log files every time the specified time passes.
| |
ArchiveFileKind |
Is the ArchiveFileName an absolute or relative path?
| |
ArchiveFileName |
Gets or sets the name of the file to be used for an archive.
| |
ArchiveNumbering |
Gets or sets the way file archives are numbered.
| |
ArchiveOldFileOnStartup |
Gets or sets a value indicating whether to archive old log file on startup.
| |
ArchiveOldFileOnStartupAboveSize |
Gets or sets a value of the file size threshold to archive old log file on startup.
| |
AutoFlush |
Gets or sets a value indicating whether to automatically flush the file buffers after each log message.
| |
BufferSize |
Gets or sets the log file buffer size in bytes.
| |
CleanupFileName |
Cleanup invalid values in a filename, e.g. slashes in a filename. If set to true, this can impact the performance of massive writes.
If set to false, nothing gets written when the filename is wrong.
| |
ConcurrentWriteAttemptDelay |
Gets or sets the delay in milliseconds to wait before attempting to write to the file again.
| |
ConcurrentWriteAttempts |
Gets or sets the number of times the write is appended on the file before NLog
discards the log message.
| |
ConcurrentWrites |
Gets or sets a value indicating whether concurrent writes to the log file by multiple processes on the same host.
| |
CreateDirs |
Gets or sets a value indicating whether to create directories if they do not exist.
| |
DeleteOldFileOnStartup |
Gets or sets a value indicating whether to delete old log file on startup.
| |
DiscardAll |
Gets or sets whether or not this target should just discard all data that its asked to write.
Mostly used for when testing NLog Stack except final write
| |
EnableArchiveFileCompression |
Gets or sets a value indicating whether to compress archive files into the zip archive format.
| |
EnableFileDelete |
Gets or sets a value indicating whether to enable log file(s) to be deleted.
| |
Encoding |
Gets or sets the file encoding.
| |
FileAttributes |
Gets or sets the file attributes (Windows only).
| |
FileCompressor |
Used to compress log files during archiving.
This may be used to provide your own implementation of a zip file compressor,
on platforms other than .Net4.5.
Defaults to ZipArchiveFileCompressor on .Net4.5 and to null otherwise.
| |
FileName |
Gets or sets the name of the file to write to.
| |
FileNameKind |
Is the FileName an absolute or relative path?
| |
Footer |
Gets or sets the footer.
(Inherited from TargetWithLayoutHeaderAndFooter.) | |
ForceManaged |
Gets or set a value indicating whether a managed file stream is forced, instead of using the native implementation.
| |
ForceMutexConcurrentWrites |
Gets or sets a value indicating whether file creation calls should be synchronized by a system global mutex.
| |
Header |
Gets or sets the header.
(Inherited from TargetWithLayoutHeaderAndFooter.) | |
IsInitialized |
Gets a value indicating whether the target has been initialized.
(Inherited from Target.) | |
KeepFileOpen |
Gets or sets a value indicating whether to keep log file open instead of opening and closing it on each logging event.
| |
Layout |
Gets or sets the text to be rendered.
(Inherited from TargetWithLayoutHeaderAndFooter.) | |
LineEnding |
Gets or sets the line ending mode.
| |
LoggingConfiguration |
Gets the logging configuration this target is part of.
(Inherited from Target.) | |
MaxArchiveDays |
Gets or sets the maximum days of archive files that should be kept.
| |
MaxArchiveFiles |
Gets or sets the maximum number of archive files that should be kept.
| |
Name |
Gets or sets the name of the target.
(Inherited from Target.) | |
NewLineChars |
Gets the characters that are appended after each line.
| |
OpenFileCacheSize |
Gets or sets the number of files to be kept open. Setting this to a higher value may improve performance
in a situation where a single File target is writing to many files
(such as splitting by level or by logger).
| |
OpenFileCacheTimeout |
Gets or sets the maximum number of seconds that files are kept open. Zero or negative means disabled.
| |
OpenFileFlushTimeout |
Gets or sets the maximum number of seconds before open files are flushed. Zero or negative means disabled.
| |
ReplaceFileContentsOnEachWrite |
Gets or sets a value indicating whether to replace file contents on each write instead of appending log message at the end.
| |
SyncRoot |
Gets the object which can be used to synchronize asynchronous operations that must rely on the .
(Inherited from Target.) | |
WriteBom |
Gets or sets a value indicating whether to write BOM (byte order mark) in created files.
Defaults to true for UTF-16 and UTF-32
| |
WriteFooterOnArchivingOnly |
Gets or sets a value indicating whether the footer should be written only when the file is archived.
| |
WriteHeaderWhenInitialFileNotEmpty |
Gets or sets whether to write the Header on initial creation of file appender, even if the file is not empty.
Default value is , which means only write header when initial file is empty (Ex. ensures valid CSV files)
|