TinyBlueRobots / Serilog.Sinks.ILogger

Serilog sink that writes to a Microsoft ILogger
The Unlicense
11 stars 3 forks source link

Serilog enriched properties as Azure Custom Properties #4

Open patricknolan opened 5 years ago

patricknolan commented 5 years ago

Hi,

I'm using the search associated with an Azure Function to view my logging and am wondering if enriched properties should be visible as Azure Custom Properties? If not is this something that's planned?

image

JonCanning commented 5 years ago

I don't know how we could do this. Having used Serilog to render the message the property names are lost, however, the ILogger would need them for the customer property names.

patricknolan commented 5 years ago

Thanks @JonCanning It would be really useful. I might try and find some time to investigate. Basically my use case is as follows

  1. Client makes a call to asp.net core api (entry point to solution)
  2. Serilog logging in API is enriched with TraceIdentifier using middleware
  3. API queues a request on azure queue storage. Request contains TraceIdentifier
  4. Azure QueueTrigger Function fires and de-queues request
  5. Serilog logging behind function is enriched with same TraceIdentifier

This allows me to trace a request through complete vertical via TraceIdentifier using Serilog enrichment. Would just be nice if TraceIdentifier property could be visible via the Azure custom properties aswell.

JonCanning commented 5 years ago

Would this be the answer?

https://github.com/serilog/serilog-sinks-applicationinsights