LAUREL BRIDGE

NLogLogAdapterReconfigureLogDirectory Method

DICOM Connectivity Framework V3.4
Reconfigures the output log directory for the file logger.

Namespace:  LaurelBridge.DCF.Examples.NLogAdapter
Assembly:  ExampleNLogAdapter (in ExampleNLogAdapter.dll) Version: DCF34 r10560 DCF_3_4_10
Syntax

C#
public void ReconfigureLogDirectory(
	string logDir,
	string targetName = "FileLogger",
	string logDirConfigName = "logDir",
	string logNameConfigName = "logName",
	string extension = ".log"
)

Parameters

logDir
Type: SystemString
The new log output directory for the file logger.
targetName (Optional)
Type: SystemString
The name of the NLog FileTarget whose log directory will be reconfigured. If none is specified, the default target name of 'FileLogger' is used.
logDirConfigName (Optional)
Type: SystemString
The name of the logDir configuration variable in the currently loaded NLog configuration. Default value is logDir.
logNameConfigName (Optional)
Type: SystemString
The name of the logName configuration variable in the currently loaded NLog configuration. Default value is logName.
extension (Optional)
Type: SystemString
The extension of the log file. Default value is .log.
Remarks

This will only change the log directory if the input log dir is not null or empty and the name of the nlog configuration file used to configure the current logger matches the expected name for this nlog log adapter.

This method is provided for testing purposes in order to programmatically alter the output directory for various types of file loggers (session logging, rotating logging, etc). It is recommended to alter the application configuration file where possible if a different output log directory is desired.

See Also

Reference