Practice question from Error Handling & Logging

What log level should be used for unexpected but recoverable situations in ASP.NET Core? A. LogDebug B. LogInformation C. LogWarning D. LogError E. LogCritical

_logger.____("Cache miss occurred, fetching from database");

Answer

C

Explanation

LogWarning is appropriate for unexpected but recoverable situations. A cache miss is not normal flow (Information) but isn't an error—it's handled by fetching from the database.

More questions from ASP.NET with .NET 10