VixenApplication.VixenApplication.SetLogFilePaths C# (CSharp) Méthode

SetLogFilePaths() private méthode

Sets the log file paths to the appropriate profile log directory
private SetLogFilePaths ( ) : void
Résultat void
        private void SetLogFilePaths()
        {
            //string logDirectory = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Vixen 3");
            string logDirectory = _rootDataDirectory;
            if (System.IO.Directory.Exists(logDirectory)) {
                NLog.Config.LoggingConfiguration config = NLog.LogManager.Configuration;
                config.AllTargets.ToList().ForEach(t => {
                    var target = t as NLog.Targets.FileTarget;
                    if (target != null) {

                        var strFileName = target.FileName.ToString().Replace("[VIXENPROFILEDIR]", logDirectory).Replace('/', '\\').Replace("'", "");
                        var strArchiveFileName = target.ArchiveFileName.ToString().Replace("[VIXENPROFILEDIR]", logDirectory).Replace('/', '\\').Replace("'", "");

                        target.FileName = strFileName;
                        target.ArchiveFileName = strArchiveFileName;
                    }
                });

                NLog.LogManager.Configuration = config;
            }
            //config.AllTargets.ToList().ForEach(t => {
            //	var target = t as NLog.Targets.FileTarget;
            //	if (target != null) {

            //		var strFileName = target.FileName.ToString().Replace("[VIXENPROFILEDIR]", _rootDataDirectory).Replace('/', '\\').Replace("'", "");
            //		var strArchiveFileName = target.ArchiveFileName.ToString().Replace("[VIXENPROFILEDIR]", _rootDataDirectory).Replace('/', '\\').Replace("'", "");

            //		target.FileName = strFileName;
            //		target.ArchiveFileName = strArchiveFileName;

            //	}

            //});
        }