cf remote debugging - beroca/shell GitHub Wiki
export CF_USER_APP_NAME=myAppName; \
cf ssh-enabled ${CF_USER_APP_NAME}; \
cf enable-ssh ${CF_USER_APP_NAME}; \
cf set-env ${CF_USER_APP_NAME} JBP_CONFIG_DEBUG '{enabled: true}'; \
cf env ${CF_USER_APP_NAME} | grep "JAVA_TOOL_OPTIONS\|JBP_CONFIG_DEBUG"
console output example:
JAVA_TOOL_OPTIONS: -Xms1g -Xmx2g -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
JBP_CONFIG_DEBUG: {enabled: true}
cf restage ${CF_USER_APP_NAME}
then, either:
cf ssh -N -T -L 8000:localhost:8000 ${CF_USER_APP_NAME}
or:
cf ssh --skip-remote-execution --disable-pseudo-tty -L 8000:localhost:8000 ${CF_USER_APP_NAME}