Code Monkey home page Code Monkey logo

serilog-enrichers-exceldna's Introduction

README.md
Serilog.Enrichers.ExcelDna

Serilog.Enrichers.ExcelDna

Enriches Serilog events with information from your Excel-DNA Add-in.

NuGet Version Stack Overflow Stack Overflow

Seq showing properties from Serilog.Enrichers.ExcelDna

Give a Star! โญ

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

Getting started ๐Ÿš€

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.

Included enrichers

The package includes:

  • WithXllPath() - adds XllPath based with the value of ExcelDnaUtil.XllPath
  • WithExcelVersion() - adds ExcelVersion with the value of ExcelDnaUtil.ExcelVersion
  • WithExcelVersionName() - adds ExcelVersionName based on ExcelDnaUtil.ExcelVersion
  • WithExcelBitness() - adds ExcelBitness based Environment.Is64BitProcess

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" />

Release History

Click on the Releases tab on GitHub.


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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.