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

OpenFile() protected method

protected OpenFile ( string fileName, bool append ) : void
fileName string
append bool
return void
		protected override void OpenFile(string fileName, bool append)
		{
			lock (this)
			{
				fileName = GetNextOutputFileName(fileName);

				long local0 = 0L;

				if (append)
				{
					using (SecurityContext.Impersonate(this))
					{
						if (System.IO.File.Exists(fileName))
						{
							local0 = new FileInfo(fileName).Length;
						}
					}
				}
				else if (LogLog.IsErrorEnabled && (_maxSizeRollBackups != 0 && FileExists(fileName)))
				{
					LogLog.Error("RollingFileAppender: INTERNAL ERROR. Append is False but OutputFile [" + fileName +
					             "] already exists.");
				}

				if (!_staticLogFileName)
				{
					_scheduledFilename = fileName;
				}

				base.OpenFile(fileName, append);

				((CountingQuietTextWriter) QuietWriter).Count = local0;
			}
		}