I am currently learning cloud foundry and experimenting with different features using a simple HelloWorld toy application.
It seems that there are two commands to monitor the application cf logs HelloWorld and cf events HelloWorld
It is pretty clear to me what cf logs does and why I would use it.
Questions about cf events:
cf events?cf events that can't be diagnosed with cf logs?The cf events command shows things like when an application is started or stopped. While that's not hugely interesting, it does also show crash information, like when you exceed your memory limit, and that can be helpful when debugging problems.
The cf logs or cf logs --recent command shows the logs for your application. This is generally anything that is written to STDOUT or STDERR by your application, but can also contain messages from a web server or application container depending on the software used to run your application. Also included in the stream are messages from select CF services like the router, staging and the dea.
It's also worth noting that cf logs or cf logs --recent will show the same information that you see in cf events (i.e. start, stop & crash info) although it's not formatted as well (it's a json blob) and if you have a noisy app it can be obscured among other messages.
I don't personally use cf events much, but occasionally it comes in handy when my app is acting weird and I want a quick check to see if it's been crashing.
"events" use "GET /v2/events" API call - CF output about application's events in CF. "logs" shows an output to STDOUT and STDERR from an application collected by loggregator CF component.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With