Click or drag to resize

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
Syntax
public Layout FileName { 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.
1${basedir}/${level}.log
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