What is the safest (least dependencies) to log startup in a Blazor app on Azure

David Thielen 2,796 Reputation points
2023-11-29T06:12:16.52+00:00

Hi all;

When my Blazor app first starts, before the ILogger system is initialized (or fails initialization), I want to be able to log four things:

  1. The very first line in main() - so I know the app started.
  2. About to call builder.Build()
  3. If there was a problem instantiating the first iLogger instance
  4. The catch for main() to log the exception.

Once builder.Build() has successfully completed and the first iLogger is instantiated, I then can use the logging system. But if any of that fails, I need logging to somewhere to tell me what failed.

So what system can I use that has as few dependencies as possible? And again, without ILogger as this is to log issues that occur before or during the creation of the first logger object.

thanks - dave

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,385 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,496 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,362 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,266 Reputation points
    2023-11-29T15:57:33.8933333+00:00