 | FileTargetFileName Property |
Gets or sets the name of the file to write to.
Namespace:
NLog.Targets
Assembly:
NLog (in NLog.dll) Version: 6.0.0+cfb73701cda54e2410b006f649f072e90daef707
Syntaxpublic Layout FileName { get; set; }
Public Property FileName As Layout
Get
Set
Dim instance As FileTarget
Dim value As Layout
value = instance.FileName
instance.FileName = value
member FileName : Layout with get, set
Property Value
Type:
Layout
Remarks[Required] Default:
Empty .
When not absolute path then relative path will be resolved against
BaseDirectory.
The FileName Layout supports layout-renderers, where a single FileTarget can write to multiple files.
Examples
The following value makes NLog write logging events to files based on the log level in the directory where
the application runs.
All
Debug messages will go to
Debug.log, all
Info messages will go to
Info.log and so on.
You can combine as many of the layout renderers as you want to produce an arbitrary log file name.
See Also