| README.md |
|---|
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.ExcelDnaTo 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:
WithXllPath()- addsXllPathbased with the value ofExcelDnaUtil.XllPathWithExcelVersion()- addsExcelVersionwith the value ofExcelDnaUtil.ExcelVersionWithExcelVersionName()- addsExcelVersionNamebased onExcelDnaUtil.ExcelVersionWithExcelBitness()- addsExcelBitnessbasedEnvironment.Is64BitProcess
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.
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.

