.net - How can I get a WebJob's logs programmatically? -


we have created azure webjob scheduled database cleanup our webapi project. want display latest job runs in our own management web app monitor how cleanup going every day. how can latest 50 function calls including corresponding output logs , durations given webjob?

some background requirement:

the cleanup process came simple suspect start bottleneck in near future, wanted monitor how long takes run each day proactively redesign using more scalable approach when needed. ideally i'd last 50 or runs , generate graph showing time took execute on period of time.

the first thing thought create our own database , wrap each execution stopwatch save duration our database. query database , build graph way.

but since first time used webjobs, found out of stuff wanted log logged automatically webjobs sdk. things start times, duration, function name, etc, exist in logs , enough build our own display around.

the problem how query logs our mvc project in suitable format. of course read blob storage directly , join data manually, looking more high level api. me storage containers used webjobs implementation detail change in future.

when searching that, found numerous ways data, feel none of them looking for.

  • there get-azurewebsitelog powershell cmdlet returns data set of runs job. looks ok, wanted callable directly .net, , i'd see console outputs action too, , can't seem find cmdlet.

  • there a webapi query logs given job. 1 seems returning exact same response powershell version (the powershell cmdlet calling same rest endpoint under covers). same problems apply.

by looking @ actual files created on blob storage account, can access output logs each run inspecting /azure-webjobs-hosts/output-logs folder , correlating id there values on /azure-webjobs-dashboard/functions/instances/ folder, suspect possible somehow them using more high level api. also, if such api available, wouldn't need worry having create type safe models each api response , things that.

you can pull these files ftp client or through web api.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -