6 Monitoring - Reference Documentation
Authors: Burt Beckwith
Version: 1.2.3
6 Monitoring
Crashes
If a deployment or update fails, the script will display the application logs but you can view crash information and logs at any time.Use the cf-crashes script to check if there have been recent crashes:$ grails cf-crashes+-------------+--------------------------------------+--------------------+ | Name | Instance ID | Crashed Time | +-------------+--------------------------------------+--------------------+ | myappname-1 | 9f3e61c9-7c64-4e57-ab3e-8d7e892dd722 | 04/11/2011 02:43PM | | myappname-2 | 17b6470c-6444-49f4-8981-d3bd7d7796dc | 04/11/2011 02:43PM | | myappname-3 | d1b99f31-203c-48e3-aa17-17ca26178a49 | 04/11/2011 02:44PM | +----------+-------------+----------------+--------------+--------------+
$ grails cf-crashlogs==== logs/stdout.log ====2011-03-03 14:50:23,904 [main] ERROR context.ContextLoader - Context initialization failed org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NullPointerException at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:87) … Caused by: java.lang.NullPointerException at $Proxy13.save(Unknown Source) … Stopping Tomcat because the context stopped.
Logs
Use the cf-logs script to view log files:$ grails cf-logs==== logs/stderr.log ====Mar 3, 2011 2:51:32 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-50478 … INFO: Server startup in 9169 ms ==== logs/stdout.log ====
$ grails cf-logs --stderr==== logs/stderr.log ====Mar 3, 2011 2:51:32 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-50478 … INFO: Server startup in 9169 ms
$ grails cf-logs target/myapp.stderr.log --stderrWrote logs/stderr.log to target/myapp.stderr.log
Viewing files
Use the cf-list-files script to view directory listings:$ grails cf-list-files /logs/ - tomcat/ -
$ grails cf-list-files tomcatbin/ - conf/ - lib/ - logs/ - temp/ - webapps/ - work/ -
$ grails cf-list-files tomcat/webappsROOT/ -
$ grails cf-list-files tomcat/webapps/ROOTMETA-INF/ - WEB-INF/ - css/ - images/ - js/ - plugins/
$ grails cf-get-file tomcat/webapps/ROOT/css/main.csshtml * { margin: 0; /*padding: 0; SELECT NOT DISPLAYED CORRECTLY IN FIREFOX */ }...
$ grails cf-get-file tomcat/webapps/ROOT/css/main.css target/main.cssWrote tomcat/webapps/ROOT/css/main.css to target/main.css
Caldecott tunnels
The plugin has support for Caldecott tunnels to connect directly to Cloud Foundry services directly. Use the cf-tunnel and cf-tunnel-disconnect scripts to connect and disconnect.To create a tunnel, enter interactive mode:$ grails
grails> cf-tunnel --service=mysql-38874c4 | Tunnel is running on localhost port 10000
grails> cf-tunnel | You have the following services defined: | 1: mysql-38874c4 > Please select a service (or 0 to quit):[0,1]
| Caldecott server app not found, deploying ...
Connect your client with username=uLQYDu4OmR9U password=pz6pQ4zxX7Jr name=d30bcdb2254a457e9c3662da8f5da089 Example mysql client usage: mysql -h 127.0.0.1 -P 10000 -u uLQYDu4OmR9U -ppz6pQ4zxX7Jr -D d30bcdb2254a457e9c3662da8f5da089