Firstly, this project looks excellent and seems to compliment your other libraries. I have a few questions
1) Is there any thought of logging MessagePack serialized byte[] straight to file with headers to speed up reading them? Eg multiple serialized objects written to same file.
2) Often I need to log to files where the filename is unknown until time of logging. Is it possible to create new filenames when logging? For example, Serilog uses sinks and NLog has variables. Eg something like this...
// Serilog
string logPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), $"SomePath");
Log.Logger = new LoggerConfiguration().WriteTo.Map("Filename", "DefaultFileName.txt", (name, wt) => wt.File($"{logPath}/{name}",
outputTemplate: "{Message}{NewLine}",
flushToDiskInterval: TimeSpan.FromSeconds(1),
encoding: Encoding.UTF8
)).CreateLogger();
[Benchmark]
public void SerilogWriter2()
{
for (int i = 0; i < N; i++)
{
for (int m = 0; m < M; m++)
{
Log.ForContext("Filename", $"{m}.txt").Information(s);
}
}
Log.CloseAndFlush();
}
// NLog
[Benchmark(Baseline = true)]
public void NLogWriter()
{
for (int i = 0; i < N; i++)
{
for (int m = 0; m < M; m++)
{
loggerBf.WithProperty("VarFilename", $"{m}.txt").Info(s);
}
}
// Important - https://github.com/NLog/NLog/wiki/Tutorial#5-remember-to-flush
// Flush and close down internal threads and timers
NLog.LogManager.Shutdown();
}
Hello,
Firstly, this project looks excellent and seems to compliment your other libraries. I have a few questions
1) Is there any thought of logging MessagePack serialized byte[] straight to file with headers to speed up reading them? Eg multiple serialized objects written to same file. 2) Often I need to log to files where the filename is unknown until time of logging. Is it possible to create new filenames when logging? For example, Serilog uses sinks and NLog has variables. Eg something like this...