0
votes

Is it possible to configure to store System.Diagnostics.Trace logs immediate in a table storage? Azure portal provide the configuration of the trace output of a Web App to a blob storage under App Service / Monitoring / Diagnostics Logs, but I cannot find the possibility for an output to a table storage in the portal.

1

1 Answers

0
votes

Only Blob Storage is supported out of the box. You could extend your application to write to Table Storage, however if storing the logs in a durable database is what you're after you may want to look at CosmosDB instead. There's more work involved for doing it with Table Storage in a way that makes it easily query-able, but entirely possible.

Whatever you choose avoid DoS-ing your service with the logging logic - call it on a background thread, be chunky not chatty and handle logging errors gracefully. Time-bound all external calls so you don't have to wait around minutes for a logging call to fail, a cascading failure is just around the corner if you pile up calls. Be ready to sacrifice logging if you're nearing compute or socket capacity limits.

If you need every single line of log, you need it RIGHT NOW and there's a business decision telling you so, it's not logging, it's auditing.