<PackageReference Include="Microsoft.ApplicationInsights" Version="3.1.0" />

Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.SelfDiagnostics.MemoryMappedFileHandler

MemoryMappedFileHandler open a MemoryMappedFile of a certain size at a certain file path. The class provides a stream object with proper write position. The stream is cached in ThreadLocal to be thread-safe.
public static readonly byte[] MessageOnNewFile

public string CurrentFilePath { get; }

public string LogDirectory { get; set; }

public int LogFileSize { get; }

public void CloseLogFile()

Close the all the resources related to the file created for MemoryMappedFile.

public void CreateLogFile(string logDirectory, int fileSize)

Create a log file. If the file already exists, it will be overwritten.

public void Dispose()

public virtual void Write(byte[] buffer, int byteCount)

Circularly write to the file. If write operation reaches the end of the file, start writing from the beginning of the file.