Serilog.Sinks.OCEL
1.0.9
See the version list below for details.
dotnet add package Serilog.Sinks.OCEL --version 1.0.9
NuGet\Install-Package Serilog.Sinks.OCEL -Version 1.0.9
<PackageReference Include="Serilog.Sinks.OCEL" Version="1.0.9" />
paket add Serilog.Sinks.OCEL --version 1.0.9
#r "nuget: Serilog.Sinks.OCEL, 1.0.9"
// Install Serilog.Sinks.OCEL as a Cake Addin #addin nuget:?package=Serilog.Sinks.OCEL&version=1.0.9 // Install Serilog.Sinks.OCEL as a Cake Tool #tool nuget:?package=Serilog.Sinks.OCEL&version=1.0.9
Serilog.Sinks.OCEL
Serilog sinks that write events to Object-Centric Event Logs (OCEL) [1], using the .NET OCEL library.
There is a separate sinks for each of the supported OCEL format: Serilog.Sinks.OCEL.Sinks.OcelJsonSink
, Serilog.Sinks.OCEL.Sinks.OcelXmlSink
, and Serilog.Sinks.OCEL.Sinks.OcelLiteDbSink
.
Rolling files are supported by configuring the log directory and file name separately. Depending on the rolling period, the file name is prepended with an identifier.
Sample configuration:
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.WriteTo.OcelLiteDbSink(new LiteDbSinkOptions(string.Empty, "log.db", RollingPeriod.Never))
.CreateLogger();
Or via appsettings.json
(using Serilog.Settings.Configuration):
"Serilog": {
"MinimumLevel": {
"Default": "Information"
},
"WriteTo": [
{
"Name": "Console"
},
{
"Name": "OcelJsonSink",
"Args": {
"directory": "",
"fileName": "log.jsonocel",
"rollingPeriod": "Month",
"formatting": "Indented",
"prefix": "myprefix_"
}
}
]
}
Supported formats
The OCEL standard is defined for both JSON and XML. Both include a validation schema that is used by the library to validate input.
An additional useful format is to store OCEL data in document databases such as MongoDB [2]. A very good alternative for .NET is LiteDB, which is an embedded NoSQL database that is similar to MongoDB. It allows writing to files directly and does not require a database server to use. Support for MongoDB will be evaluated in the future.
Format | Status |
---|---|
JSON | Implemented |
XML | Implemented |
LiteDB | Implemented |
MongoDB | TBD |
Performance
JSON and XML files cannot simply be appended like a text file or a database table. The entire file has to be rewritten each time, which is expensive. If you are going to use either the JSON or XML sink, make sure to use short rolling periods to avoid log files with more than a few thousand events at a time. It is generally recommended to use the LiteDb sink for all logging due to better performance, even though LiteDb files tend to be larger in size overall. The OCEL library can be used to later convert between formats or even merge multiple files together.
References
[1] Farhang, A., Park, G. G., Berti, A., & Aalst, W. Van Der. (2020). OCEL Standard. http://ocel-standard.org/
[2] Berti, A., Ghahfarokhi, A. F., Park, G., & van der Aalst, W. M. P. (2021). A Scalable Database for the Storage of Object-Centric Event Logs. CEUR Workshop Proceedings, 3098, 19–20. https://arxiv.org/abs/2202.05639.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- OCEL.CSharp (>= 1.3.3)
- Serilog (>= 3.0.1)
- Serilog.Sinks.PeriodicBatching (>= 3.1.0)
-
net6.0
- OCEL.CSharp (>= 1.3.3)
- Serilog (>= 3.0.1)
- Serilog.Sinks.PeriodicBatching (>= 3.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.