Expose WebJob Context Information To Custom TraceWriters
See original GitHub issueIn an attempt to make reviewing/querying WebJob logs easier, I took advantage of the JobHostConfiguration.Tracing.Tracers
collection and added a custom SqlTraceWriter
to my WebJob project (sample code here).
This works pretty well but can get somewhat confusing due to WebJobs being executed in parallel.
Would it be possible to expose some of the WebJob Context information to the TraceWriter?
Either via a static class or by passing it into the TraceWriter.Trace()
method perhaps?
The various *InstanceId
s could be added to the SQL Table to help identify logs from the same job.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Retrieving information about the currently running function
Function context information is exposed by the $TriggerMetadata variable in the run.ps1 file. This variable contains the function name, ...
Read more >How to use the WebJobs SDK - Azure App Service
Learn more about how to write code for the WebJobs SDK. Create event-driven background processing jobs that access data in Azure and ...
Read more >FunctionInvokerBase.CreateUserTraceWriter(TraceWriter ...
WebJobs.Script.Description.FunctionInvokerBase.CreateUserTraceWriter in the Microsoft.Azure.WebJobs.Script.Description namespace.
Read more >Azure Functions The Journey - Azure App Service
In Chris's //build talk Introducing Azure Functions he explained how Azure Functions is built on the Azure WebJobs SDK. The WebJobs SDK has ......
Read more >suppress logging in azure webjobs ("executing: '
If that isn't what you want, you could register your own custom TraceWriter via the JobHostConfiguration.Tracing.Tracers collection. If you then replaced your ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
TraceEvent.Properties
will now include function information – available properties found here: https://github.com/Azure/azure-webjobs-sdk/blob/master/src/Microsoft.Azure.WebJobs.Host/Loggers/TraceEventExtensions.cs@brettsam can get it up on our myget feed for you to access. We won’t be doing nuget.org update for a while.