This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved.
As a CF hero
I want to know what my CF app is doing
So that I can debug it
# From the training home directory:
$ cd 06-debugging/debug-app
$ cf push
...
urls: debug-app-unerring-muddlehead.cfapps.io
...
$ cf logs debug-app --recent
...
... [App/0] ERR ... - RuntimeError - I am a bug, fix me:
... [App/0] ERR /home/vcap/app/config.ru:20:in `block in <class:Web>
$ cf logs debug-app # Tails app logs, CTRL + C to exit
$ cf set-env debug-app FIXED true
$ cf restart debug-app
$ cf events debug-app
... description
... index: 0, reason: CRASHED, exit_description: 2 error(s) ...
...
Included in Java buildpack
$ cf create-service newrelic standard newrelic
$ cf bind-service debug-app newrelic
$ cf env debug-app
# Find your New Relic license key
# From the training home directory:
$ cd 06-debugging/debug-app
# Replace YOUR-LICENSE-KEY
$ vim newrelic.yml
$ cf push
$ cf service newrelic
$ cf ssh debug-app
As a CF hero
I want to know what my CF app is doing
So that I can debug it
Questions cannot be stupid. Answers can.
Send app logs to Papertrail
$ cf cups logdrain -l syslog://YOUR-PAPERTRAIL-LOG-DESTINATION
$ cf bind-service debug-app logdrain
# Check your Papertrail Events, no need to restart the app
This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved.