How paulossjunior/serialogexample works
Main Components
a) Application Layer Components:
• Minimal API (.NET 8)
• Configuration Management
• Service Layer
• Repository Layer
• Models
• Logging Infrastructure
b) External Components:
• Seq Server
• File System (for file-based logs)
• Console Output
┌─ Client Layer ─────────────────────────┐
• HTTP Clients (Browser/Curl/etc.) │
• ┬───────────────────┘
• ↓
┌─ API Layer ───────────────────────────┐
• Minimal API Endpoints (.NET 8) │
• ┬───────────────────┘
• ↓
┌─ Service Layer ───────────────────────┐
• UserService │
• ┬───────────────────┘
• ↓
┌─ Repository Layer ────────────────────┐
• UserRepository │
• ┬───────────────────┘
• ↓
┌─ Logging Infrastructure ──────────────────────────────┐
• ┌─────────────┐ ┌──────────┐ ┌──────────────────┐ │
• Serilog │ │ Enrichers│ │ Log Configuration│ │
• ┬──────┘ └─────┬────┘ └────────┬─────────┘ │
• ┼──────────────┼─────────────────┼───────────┘
┌────────▼──────┐ ┌────▼────┐ ┌──────▼─────┐
• Seq Server │ │ File Logs│ │ Console │
• ┘ └─────────┘ └────────────┘
Important Elements to Highlight
a) Data Flow:
• HTTP requests flow from clients to API
• Log message flow through Serilog to different sinks
• Enricher injection points
b) Configuration Components:
• LoggerConfig.cs location and influence
• Environment-specific settings (Development/Production)
Additional Details
Specific project elements:
• Log Enrichers (Machine Name, Environment, Thread ID, Client IP)
• Multiple Sink Outputs (Console, File, Seq)
• Docker container boundaries
• API Endpoints (/users)
Technical Details
• .NET 8 Runtime
• Serilog Configuration
• Docker network
• File system mounts for logs
• Seq dashboard access