There are a ton of resources to set up logging for an Azure app service, but all I have found are fairly complex setting up a ton of stuff. This is for a Blazor server (ASP.NET Core) app that uses ILogger for all logging.
What I want is the equivalent of there's a log file and I can search for two things:
So I need the logs to be saved off somewhere where I can then view this. I know I can do it with Application Insights but that strikes me as overkill. I know writing to a file won't work because any given VM might be swapped out by Azure and then bye bye log file. Serilog, even more so than Application Insights, lot of work for this simple need.
So... is there a way to do this? Or should I use Application Insights for this?
How can I set up simple logging for an Azure App Service?
To set up logging for Azure App Service:
Other than Application Insights, you can use below approach:
Windows:
If your App Service is running on windows,
Linux:
If your App Service is running on windows, Enable Application Logging (File System):
You can check the real-time logs in LogStream:
References:
Azure App Service Logging: How to Monitor Your Web Apps in Real-Time (microsoft.com)