Acl.CommStreamLog
4.0.0
See the version list below for details.
dotnet add package Acl.CommStreamLog --version 4.0.0
NuGet\Install-Package Acl.CommStreamLog -Version 4.0.0
<PackageReference Include="Acl.CommStreamLog" Version="4.0.0" />
<PackageVersion Include="Acl.CommStreamLog" Version="4.0.0" />
<PackageReference Include="Acl.CommStreamLog" />
paket add Acl.CommStreamLog --version 4.0.0
#r "nuget: Acl.CommStreamLog, 4.0.0"
#:package Acl.CommStreamLog@4.0.0
#addin nuget:?package=Acl.CommStreamLog&version=4.0.0
#tool nuget:?package=Acl.CommStreamLog&version=4.0.0
Acl.CommStreamLog
A binary communication-stream log library. It persists the raw binary payloads exchanged between communicating peers into self-describing binary files, supporting per-hour / per-day / permanent storage, automatic rollover by size or record count, expiry cleanup, memory-mapped fast reading, and a pluggable parser framework.
Target frameworks: net48, net6.0, net8.0, net10.0
- net6.0+ targets have zero third-party dependencies.
- On
net48,System.MemoryandSystem.Text.Jsonare referenced automatically (PolySharp supplies newer language features at compile time only).
Usage
using System;
using System.Threading;
using Acl.CommStreamLog;
using Acl.CommStreamLog.Data;
using Acl.CommStreamLog.IO;
// 1. Configure and create a writer (writers with the same LogKey are reused).
var settings = LogFileSettings.Create("ATS-ATP", @"D:\ATS\CommLog", 0x1001, 0x2001);
settings.StorageType = StorageType.Daily; // SharpHourly / Daily / Permanent
settings.ExpiredDays = 7;
settings.MaxFileSize = 8 * 1024 * 1024; // optional rollover threshold
var writer = CommStreamLogManager.CreateLogWriter(settings);
// 2. Write a record (payload <= 64 KB).
var record = CommStreamLogFile.NewRecord();
record.Content = payloadBytes; // raw communication bytes
record.Header.Direction = StreamDirection.Input;
record.Header.TimeStamp = DateTime.Now;
writer.Write(record);
// 3. Dispose all writers before process exit.
CommStreamLogManager.Close();
Reading back:
using var reader = CommStreamLogManager.CreateFileStreamLogReader(@"D:\ATS\CommLog\... .commStreamLog");
var fileHeader = await reader.ReadFileHeaderAsync(CancellationToken.None);
await reader.ReadRecordHeadersAsync(CancellationToken.None); // build the record index
var record = reader.GetRecord(0); // random access by index
A memory-mapped reader is available via CommStreamLogManager.CreateMemMappedLogReader(path).
Parser framework
Parsers are external assemblies that implement ICommLogRecordParser (or IPayloadLogRecordParser / IBytesParserSimilarityMatchable). They are auto-discovered by ParserManager.LoadParsers(paths) and can also be added globally through parsers\load.json next to the application:
{
"extraPaths": [
{ "path": "D:\\Parsers", "includeSubDirectories": true },
{ "path": "D:\\ATS\\", "includeSubDirectories": false }
]
}
License
MIT. See the repository root for the full license and the in-depth documentation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- System.Memory (>= 4.6.3)
- System.Text.Json (>= 10.0.11)
-
net10.0
- No dependencies.
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Support for net8.0