0

I would like to add to Serilog logs Function Name property. Function Name can be extracted from Execution Context which is available via Dependency Injection. And the best way to add it would be Enricher.

The only way that I find to use DI with Enrichers is by .UseSerilog but it can't be used in Azure Startup class.

So do you have any idea how this might be accomplished?

dyniax
  • 21
  • 1
  • Are you already using Serilog in your function and only need to add Enricher? Or looking for complete fresh setup? – krishg Sep 25 '20 at 06:53
  • @KrishnenduGhosh-MSFT - we already configured Serilog, and we found that it would be good to have Function Name in logs. And from my understanding Enricher would be the best solution here. But we implement some new solution. – dyniax Sep 25 '20 at 10:22
  • Ok. Can you post a little snippet of existing code on how you setup Serilog and also how you are using ILogger (if not default). – krishg Sep 25 '20 at 13:09

0 Answers0