Tuesday, July 8, 2014

How to track the error log on BlueMix

Sometimes when we run the application or deploy the application we will meet all kinds of strange error.Is that a way to check that. I forward the answer from dw.Hope it will help you.

This is a 14 step must-gather when the app fails to stage or does not work correctly at runtime ....
1.cf logs appName --recent
2.cf events appName will reveal errors that staging sometimes won't like OOM errors or PORT not being listened on.
3.cf files appName logs/messages.log logs/staging_task.log and other log files in the logs/ directory
4.To enable trace for the Liberty server configure a traceSpecification stanza in the server.xml and push a server package.
5.If you bound any services, cf files appName logs/env.log | grep VCAP_SERVICES will give you any service connection and credential information.
6.For Liberty server configuration look at cf files appName app/.liberty/usr/servers/defaultServer/server.xml
7.cf se JBP_LOG_LEVEL DEBUG will turn on debug logs in the buildpack that can be accessed with cf files appName app/.buildpack-diagnostics/buildpack.log
8.If you need CF level trace and GUIDs etc to talk to the cloud controller via REST APIs then set the environment variable CF_TRACE to true on the command line. Syntax depends on the OS.
9.Confirm that the war/ear/jar/server-package file works on standalone liberty
10.Look at the VCAP_SERVICES environment variable information from the ace tool.
11.If you don't have access to the logs then do a cf push from one window and cf tail logs in the other command window.
12.Push using the open source liberty Buildpack with the -b option. cf push appName -p /absolute/path/my.war -b https://github.com/cloudfoundry/ibm-websphere-liberty-buildpack.git
13.Fork the OSS buildpack and push it as an application on Bluemix. This is called buildpack as an app and enables you work with your fork of the BP on BlueMix. Details on this later.
14.If ALL fails then try pushing to a CF installed locally via bosh-lite or push to an alternate environment
■REPLACE appName with the name of your app
■There are a number of ways to push an application to BlueMix i.e. via 1. command line 2. eclipse & 3. JazzHub. The best way to debug, is by pushing the built artifact (war/ear/jar/server-package) via the cf command line since the command line gives complete control on file navigation and insight into CF.
■For other troubleshooting tips checkout https://www.ng.bluemix.net/docs/FAQ.jsp


  1. BlueHost is ultimately one of the best website hosting provider for any hosting services you require.