Basedir layout renderer - NLog/NLog GitHub Wiki
The current application AppDomain.BaseDirectory, and usually the location of application-binaries.
Platforms Supported: All
See also ${processdir}, ${specialfolder}, ${currentdir}, ${tempdir}
Configuration Syntax
${basedir:dir=String:file=String:processDir=boolean}
Parameters
Advanced Options
- dir - Name of the directory to be Path.Combine()'d with the base directory.
- file - Name of the file to be Path.Combine()'d with the base directory.
- processDir - Introduced in NLog 4.4.2. Render the base directory of the current process? Default
false
.Alternative one can use the
${processdir}
introduced with NLog v4.7.1 - fixTempDir - Enable automatic fallback to processDir when detecting AppDomain.BaseDirectory is temp-directory. Workaround for single-file-publish on NetCore 3.1, and no longer needed with .NET 6.
Introduced with NLog v4.6.8
See also: FileTarget FileName Directory