
Logging, Monitoring & Observability
ILogger, Serilog, Application Insights, OpenTelemetry (traces, metrics), health checks, structured logging
1What is the ILogger interface in .NET?
What is the ILogger interface in .NET?
Câu trả lời
ILogger is the standard logging interface provided by Microsoft.Extensions.Logging. It defines a uniform contract for recording messages at different severity levels, allowing abstraction of the concrete logging system implementation. This abstraction makes it easy to switch log providers without modifying application code and facilitates unit testing through dependency injection.
2What are the log levels available in ILogger, from least to most severe?
What are the log levels available in ILogger, from least to most severe?
Câu trả lời
ILogger defines six ordered severity levels: Trace for detailed debugging, Debug for development information, Information for normal application flow, Warning for abnormal but non-blocking situations, Error for recoverable errors, and Critical for system failures requiring immediate intervention. This hierarchy allows filtering logs based on the environment.
3What is the main difference between LogLevel.Debug and LogLevel.Trace?
What is the main difference between LogLevel.Debug and LogLevel.Trace?
Câu trả lời
Trace is the most verbose level, intended for very detailed diagnostic information like line-by-line execution flow, while Debug contains information useful for development but less granular. In production, both are typically disabled, but Trace generates much more volume and can impact performance even in development if misused.
How to inject ILogger into a service class in .NET?
What is structured logging and what advantage does it provide?
+19 câu hỏi phỏng vấn
Các chủ đề phỏng vấn .NET khác
C# Basics
LINQ & Delegates
C# Language Essentials
ASP.NET Core Fundamentals
ASP.NET Core Request Lifecycle
Configuration & Settings
Application Lifecycle
Dependency Injection
Entity Framework Core
Minimal APIs
Web API Development
Async in ASP.NET Core
Authentication & Authorization
HttpClient & Networking
JSON Serialization
Entity Framework Core Advanced
C# Advanced Features
Clean Architecture
Unit Testing & xUnit
Integration Testing
Docker & Containerization
NuGet Package Management
Memory Management & GC
Reactive Programming
Async/await & Patterns
.NET Design Patterns
Performance Optimization
Security & Best Practices
SignalR & Real-time
Microservices Architecture
Nắm vững .NET cho lần phỏng vấn tiếp theo
Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.
Bắt đầu miễn phí