Monitoring & Logging
Set up monitoring and logging for your edge applications to track performance and debug issues.
Why Monitor & Log Edge Apps?
When your applications run at the edge, they're distributed globally. This makes it challenging to know what's happening without good visibility.
Monitoring helps you track performance metrics like request times and error rates across your entire system. Logging gives you detailed records of individual events, like requests or errors, which are crucial for debugging.
Basic Logging: console.log
The simplest way to log information in a Cloudflare Worker is by using console.log(). This works much like logging in a browser or Node.js environment.
Messages sent to console.log() are captured by Cloudflare and can be viewed in your Worker's dashboard or exported using Logpush.
All lessons in this course
- Caching Strategies
- Cold Starts & Warmups
- Monitoring & Logging
- Bundle Size & Code Optimization