NLog.Targets.FileTarget.DynamicFileArchive.GetNextArchiveFileName C# (CSharp) Method

GetNextArchiveFileName() private method

Gets the file name for the next archive file by appending a number to the provided "base"-filename. Example: Original Filename trace.log Target Filename trace.15.log
private GetNextArchiveFileName ( string fileName ) : string
fileName string Original file name.
return string
            private string GetNextArchiveFileName(string fileName)
            {
                int currentArchiveNumber = archiveFileQueue.Count == 0 ? 0 : ExtractArchiveNumberFromFileName(archiveFileQueue.Last());
                string archiveFileName = string.Format("{0}.{1}{2}", Path.GetFileNameWithoutExtension(fileName), currentArchiveNumber + 1, Path.GetExtension(fileName));
                return Path.Combine(Path.GetDirectoryName(fileName), archiveFileName);
            }