Serilog.Sinks.OCEL 1.0.10

dotnet add package Serilog.Sinks.OCEL --version 1.0.10                
NuGet\Install-Package Serilog.Sinks.OCEL -Version 1.0.10                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Serilog.Sinks.OCEL" Version="1.0.10" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Serilog.Sinks.OCEL --version 1.0.10                
#r "nuget: Serilog.Sinks.OCEL, 1.0.10"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Serilog.Sinks.OCEL as a Cake Addin
#addin nuget:?package=Serilog.Sinks.OCEL&version=1.0.10

// Install Serilog.Sinks.OCEL as a Cake Tool
#tool nuget:?package=Serilog.Sinks.OCEL&version=1.0.10                

Serilog.Sinks.OCEL

GitHub GitHub Workflow Status Nuget (with prereleases) Nuget

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.10 223 9/5/2023
1.0.9 237 8/11/2023
1.0.8 167 8/11/2023
1.0.7 165 8/11/2023
1.0.6 163 8/9/2023
1.0.5 144 5/11/2023
1.0.4 247 3/8/2023
1.0.3 238 3/8/2023
1.0.2 228 3/7/2023
1.0.1 256 2/8/2023
1.0.0 306 1/16/2023