GithubHelp home page GithubHelp logo

soenneker / serilog-sinks-xunit-injectable Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 1.0 132 KB

The injectable, Serilog xUnit test output sink

License: MIT License

C# 100.00%
csharp dotnet logging serilog testing xunit

serilog-sinks-xunit-injectable's Introduction

Hi, I'm Jake

Crafting fast, intuitive tools with cutting-edge tech to tackle challenges head-on

C#.NETAzureBlazor Redis Cosmos DB Bootstrap Swagger Cloudflare HTML5 JS xUnit Serilog ML.NET

I do stuff with data:

  • Azure Machine Learning
  • ML.NET
  • Azure Cognitive Services
  • Azure Messaging/Storage

My passions:

  • ⚖️ Pursuing knowledge, concepts, and philosophy
  • ⚔️ Battling complexity, chaos, and entropy with elegant solutions
  • 🏛️ Architectural design and implementing patterns
  • 🔄 Streamlining processes, testing, and striving for continuous improvement
  • 💬 Engaging with Large Language Models (like ChatGPT)

serilog-sinks-xunit-injectable's People

Contributors

dependabot[bot] avatar renovate[bot] avatar soenneker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

cmgrd

serilog-sinks-xunit-injectable's Issues

Can't override output template

First of all thanks for saving me a ton of time with my test debugging, I was really struggling to get logging from my asp.net fixture to appear in the correct place before I started using your tool.

One suggestion is that it would be great to be able to override the outpoutTemplate to include things like the source context. I can see that it could be done by changing the const output template to a property that the user can set, or as a parameter to the constructor of InjectableTestOutputSink. Happy to put in a PR for it, but I'm not sure how it would get published to nuget. Let me know what is the best path forward.

Is there a way to configure this from appsettings.json

Thanks for writing this application, really appreciated, documented very well.

I was wondering, if there is way to configure this from appsettings.json

I have a file "appsettings.Testing.json" for all my testing related settings.

so that my serilog code will read this.
builder.Host.UseSerilog((context, services, configuration) => configuration .ReadFrom.Configuration(context.Configuration) .ReadFrom.Services(services) );

"WriteTo": [ { "Name": "InjectableTestOutputSink", "Args": { "restrictedToMinimumLevel": "Verbose", "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{SourceContext}] [{Level}] [InstanceId: {InstanceId}] [ReqId: {RequestId}] [CorrelationId: {CorrelationId}] {Message}{NewLine}{Exception}" } } ],

Thanks.

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.