Application Logging
summary
Argues for structured logging with concrete tools and rules: use Monolog in PHP, attach context JSON (order_id, payment_id, duration) so logs are queryable, and send logs to a local sink (file, Redis/RabbitMQ) rather than remote APIs; then ingest with vector.dev for dashboards and alerts. Warns about cost (example: 20 messages → 2s if each API call is 100 ms), avoid logging secrets, prefer existing exception stack traces, and always measure the actual performance impact.
AI-written summary · about
chapters (16)
- 0:00Introduction to app logging
- 2:10Why logging matters
- 3:55Limitations of infra logs
- 5:37Solving problems with logging
- 8:07What a log entry should look like
- 9:54Monolog for PHP logging
- 12:03Log levels explained
- 13:50Setting up Monolog
- 15:13Structured logging benefits
- 17:44Logs to metrics
- 20:10Events to log
- 21:54What not to log
- 22:59Logging performance impact
- 25:06Recap and key takeaways
- 25:31Q&A: Stack traces in logs?
- 26:40Q&A: Microservices logging








