Skip to content

b226876c 16cb 13d1 1f24 9c3820b689d2

Axel Kesseler edited this page Mar 1, 2023 · 14 revisions

PersistentLoggerSettings.Filename Property

Gets or sets the fully qualified filename.

Namespace: Plexdata.LogWriter.Settings
Assembly: Plexdata.LogWriter.Persistent (in Plexdata.LogWriter.Persistent.dll) Version: 1.0.7.1

Syntax

C#

public string Filename { get; set; }

Property Value

Type: String
The fully qualified name of the logging file.

Implements

IPersistentLoggerSettings.Filename

Exceptions

 

Exception Condition
Exception This property may throw several exceptions. For more information about these exceptions please see EnsureFullPathAndWriteAccessOrThrow(String).

Remarks

This property allows to change the fully qualified name of the assigned logging file.

The value assigned to this property can also contain environment variables, such as %TMP% for example. But note, no matter which platform is used, each of the environment variables must be surrounded by a percentage character (%). Otherwise, resolving environment variables may fail and ends up in an exception.

Examples

Below find some examples of how to use environment variables in filenames. C#

settings.Filename = "%TMP%\\output.log";
settings.Filename = "%TEMP%\\output.log";
settings.Filename = "%LOCALAPPDATA%\\Temp\\output.log";
settings.Filename = "%HOMEDRIVE%%HOMEPATH%\\AppData\\Local\\Temp\\output.log";

See Also

Reference

PersistentLoggerSettings Class
Plexdata.LogWriter.Settings Namespace
SettingsValidationExtension.EnsureFullPathAndWriteAccessOrThrow(String)

Clone this wiki locally