Tp.Integration.Plugin.Common.Activity.PluginRollingFileAppender.RollFile C# (CSharp) Method

RollFile() protected method

protected RollFile ( string fromFile, string toFile ) : void
fromFile string
toFile string
return void
		protected void RollFile(string fromFile, string toFile)
		{
			using (SecurityContext.Impersonate(this))
			{
				if (FileExists(fromFile))
				{
					DeleteFile(toFile);

					try
					{
						LogLog.Debug("RollingFileAppender: Moving [" + fromFile + "] -> [" + toFile + "]");

						System.IO.File.Move(fromFile, toFile);
					}
					catch (Exception ex)
					{
						ErrorHandler.Error("Exception while rolling file [" + fromFile + "] -> [" + toFile + "]", ex,
						                   ErrorCode.GenericFailure);
					}
				}
				else
				{
					LogLog.Warn("RollingFileAppender: Cannot RollFile [" + fromFile + "] -> [" + toFile + "]. Source does not exist");
				}
			}
		}