Logging and System Visibility
Comprehensive observability across Grade My Investments' entire ecosystem
Observability Architecture
Grade My Investments implements a comprehensive logging and monitoring strategy that provides full system visibility across all applications, services, and infrastructure components. Our multi-layered approach ensures rapid issue detection, detailed performance insights, and complete audit trails.
flowchart LR
subgraph APPS[Source Applications]
CW[Client Web<br/>ILogger]:::app
AW[Admin Web<br/>ILogger]:::app
MA[MAUI Mobile<br/>ILogger]:::app
CS[Console Services<br/>ILogger x11]:::svc
RG[ReportGenerator<br/>Serilog]:::svc
AF[Azure Functions<br/>App Insights]:::ext
end
subgraph LEVELS[Log Levels]
L1[CRITICAL - Fatal]:::sec
L2[ERROR]:::sec
L3[WARNING]:::sec
L4[INFORMATION]:::app
L5[DEBUG - TRACE]:::svc
end
subgraph STORAGE[Storage and Analysis]
AS[App Service Logs<br/>Azure Portal]:::ext
AI[Application Insights<br/>KQL - Dashboards]:::ext
DB[(activitylogentries<br/>MySQL)]:::data
VF[VM Log Files<br/>opt-gmi-logs]:::data
end
APPS --> LEVELS
LEVELS --> AS
AF --> AI
CW --> DB
AW --> DB
CS --> VF
RG --> VF
classDef app fill:#1f2630,stroke:#C0894E,color:#F3EFE8;
classDef svc fill:#241c14,stroke:#E2B583,color:#F3EFE8;
classDef data fill:#22201a,stroke:#C0894E,color:#EBD3AE;
classDef ext fill:#1b1f27,stroke:#5A616B,color:#C4C0B8;
classDef sec fill:#1d2733,stroke:#5cc8e0,color:#eafaff;
5 Levels
Logging Hierarchy15+ Apps
Instrumented ServicesReal-time
Console + File OutputStructured
ILogger + SerilogLogging Levels and Hierarchy
Grade My Investments employs a structured logging approach with five distinct levels, each serving specific purposes in system monitoring and debugging.
CRITICAL / FATAL
System-breaking errors requiring immediate attention
Examples: Database connection failures, payment processing errors, security breachesERROR
Application errors that don't crash the system but affect functionality
Examples: Failed API calls, validation errors, processing exceptionsWARNING
Potentially problematic situations that should be monitored
Examples: High memory usage, slow response times, deprecated API usageINFORMATION
General application flow and significant business events
Examples: User logins, report generations, payment completionsDEBUG / TRACE
Detailed diagnostic information for troubleshooting
Examples: Method entry/exit, variable values, SQL queriesDaily Log Distribution
Application Logging Coverage
Every component in the Grade My Investments ecosystem implements comprehensive logging, providing complete visibility across all user interactions and system operations.
Web Applications
Client Web Application
- User authentication events
- Page navigation tracking
- API request/response logging
- Client-side error capturing
Admin Web Application
- Administrative actions
- User management operations
- System configuration changes
- Report generation requests
MAUI Mobile Application
- Mobile-specific interactions
- Push notification handling
- Offline/online state changes
- Device-specific errors
Background Services
Communication Services
- SMS/Email delivery status
- Queue processing metrics
- Third-party API responses
- Rate limiting events
Report Generation
- Report processing stages
- Data retrieval performance
- Report formatting processes
- Template processing errors
Financial Operations
- Payment processing events
- Subscription state changes
- Billing calculations
- Financial data updates
Azure Functions Logging
Azure Functions provide serverless compute logging with built-in integration to Application Insights, capturing execution metrics, performance data, and custom telemetry.
Function Logging Features:
- Execution duration tracking
- Memory usage monitoring
- Cold start detection
- Dependency tracking
- Custom event logging
- Exception correlation
- Request/response payloads
- Performance counters
Key Function Categories:
HTTP Triggered Functions
API endpoints, webhooks, and web service integrationsTimer Triggered Functions
Scheduled tasks, data synchronization, and cleanup operationsEvent Triggered Functions
Message queue processing, file uploads, and real-time eventsFunction Configuration
Log Management Infrastructure
Centralized Logging Architecture
Grade My Investments employs a sophisticated logging infrastructure that aggregates, processes, and stores logs from all system components in a centralized, searchable, and highly available manner.
Collection
Structured logging from all sourcesProcessing
Filtering, parsing, and enrichmentStorage
Long-term retention and indexingAnalysis
Search, visualization, and alertingTechnology Stack:
- Microsoft.Extensions.Logging (ILogger): Built-in .NET logging across all web apps and console services
- Serilog: Structured logging with file and console sinks in ReportGeneratorAlpha
- Application Insights: Azure Functions telemetry and request tracking
- App Service Logs: Azure App Service built-in log streaming for web apps
Logging Coverage
VM Log Files
Background services write logs to /opt/gmi/logs/ for direct access via SSH
Monitoring and Alerting
Performance Monitoring
- Response time tracking
- Throughput analysis
- Resource utilization
- Capacity planning
- SLA compliance
Error Detection
- Real-time error tracking
- Error rate thresholds
- Correlation analysis
- Root cause identification
- Automated escalation
Security Monitoring
- Authentication anomalies
- Suspicious access patterns
- Data breach detection
- Compliance violations
- Security incident tracking
Alert Configuration Examples
Error Rate > 5%
SMS + Email + Slack
Immediate
15 minutes
Response Time > 2s
Email + Slack
5 minutes
30 minutes
Log Analysis and Reporting
Advanced Analytics Capabilities
Grade My Investments' logging infrastructure provides powerful analytics and reporting capabilities, enabling data-driven insights into system performance, user behavior, and business metrics.
Key Analytics Features:
- Custom KQL queries
- Interactive dashboards
- Automated reports
- Trend analysis
- Performance baselines
- Anomaly detection
- Business intelligence
- Predictive analytics