A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/augustoproiete/serilog-enrichers-exceldna below:

serilog-contrib/serilog-enrichers-exceldna: A Serilog Enricher with properties from Excel-DNA add-ins

Serilog.Enrichers.ExcelDna

If you like or are using this project please give it a star. Thanks!

Install the Serilog.Enrichers.ExcelDna package from NuGet:

Install-Package Serilog.Enrichers.ExcelDna

To apply the enricher to your logger configuration:

var log = new LoggerConfiguration()
    .Enrich.WithXllPath()
    // ... other configuration ...
    .CreateLogger();

The WithXllPath() enricher will add an XllPath property to produced events.

The package includes:

Example of an Excel-DNA add-in using Serilog with this sink

In the sample folder, there's an example of an Excel-DNA add-in that uses Serilog for logging to the LogDisplay of Excel-DNA using this sink, and apply the enrichers described above.

Excel-DNA configuration for packing with ExcelDnaPack

In order for the Excel-DNA enricher to work from an add-in that was packaged using the ExcelDnaPack utility, you need to include references to Serilog.dll and Serilog.Enrichers.ExcelDna.dll in the .dna file of the add-in:

<DnaLibrary Name="My Add-In" RuntimeVersion="v4.0">
  <ExternalLibrary Path="MyAddIn.dll" ExplicitExports="false" LoadFromBytes="true" Pack="true" />

  <Reference Path="Serilog.dll" Pack="true" />
  <Reference Path="Serilog.Enrichers.ExcelDna.dll" Pack="true" />

Click on the Releases tab on GitHub.

Copyright © 2018-2023 C. Augusto Proiete & Contributors - Provided under the Apache License, Version 2.0.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4