question

sergio-7489 avatar image
0 Votes"
sergio-7489 asked ·

Logs on AppService

I have trouble storing logs to a Storage Account.
Specifically I have an AppService (dotNet ASP api application) that internally write logs, now I want to save these logs in a permanent storage.
I've configured the "App Service Logs" to have the application logs stored in Azure Storage Container, but still I don't see any log in the storaga container. Is the AppServiceLogs configuration enough or I need to modify the application code too (like log4Net to write on the StorageContainer)?

thanks

azure-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sergio-7489 avatar image
0 Votes"
sergio-7489 answered ·

Thanks,
but besides append to a Blob Storage,
what if I want to write from log4Net application log to LogAnalytics Workspace?
What is the correct way to see my application log onto LogAnalytics?

\sergio

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

brtrachMSFT-0711 avatar image
0 Votes"
brtrachMSFT-0711 answered ·

What logs are you hoping to have access to? The below logs are able to be configured to be captured with no additional coding required (if selected during the configuration step).

  • AppServiceAntivirusScanAuditLogs

  • AppServiceHTTPLogs

  • AppServiceConsoleLogs

  • AppServiceAppLogs

  • AppServiceFileAuditLogs

  • AppServiceAuditLogs

  • AppServiceIPSecAuditLogs

  • AppServicePlatformLogs

  • AllMetrics



Where are you checking for your logs? I can see my httplogs in the Azure portal if I go to my storage account> containers blade> insights-logs-appservicehttplogs and then start drilling down.

Lastly, it sometimes can take 15-20 minutes for the logs to start propagating to the external storage. Please let us know the outcome. We look forward to your reply.

· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your answer,
I selected almost all logs and till now I can see in the storage account:
- insights-logs-appserviceauditlogs
- insights-logs-appservicehttplogs

What is "AppServiceAppLogs" for?

What I'm hoping to see is the log file the application itself write during its working.
We use inside it the log4net logger to write custom log (generally in a file), but because writing in the local file system seems to be "volatile" when you use an App Service, we want to have this log file stored a Storage Account, is it possible?

thanks
\sergio

0 Votes 0 ·

We apologize for the delay in getting back to you. The only solution we are aware of is a couple of years old and we wanted to verify that it still is the correct path before getting back to you.

Unfortunately, native writing of custom loggers such as log4net are not supported to storage accounts. You can however use something like this log4netBlobStorageAppender to write your log to your storage account.

Please let us know if there are further questions.


0 Votes 0 ·