Having the ability to retroactively troubleshoot startup failures in production is a consideration that's separate from using testing to improve startup consistency. However, it's equally or more important since despite all our efforts, we might not be able to simulate all types of real-world failures in a test or QA environment. It's also commonly the weakest area for logging as initializing the logging infrastructure is another startup activity that must be performed. The order of operations for initializing the application is an important consideration for this reason and can become a chicken and egg type of problem. For example, if we need to configure logging based on a KeyVault reference, and we fail to obtain the KeyVault value, how do we log this failure? We might want to consider duplicating startup logging using a separate logging mechanism that doesn't depend on any other external factors. For example, logging these types of startup failures to the local disk. When you turn on a general logging feature, such as [.NET Core stdout logging](/aspnet/core/test/troubleshoot-azure-iis#aspnet-core-module-stdout-log-azure-app-service), it can be counter-productive as this logging keeps generating log data even after startup, and that can fill up the disk over time. This feature can be used strategically for troubleshooting reproducible startup failures.
0 commit comments