Enabling DEBUG logging level in ensemble stitching logs in Platform Services Tile
search cancel

Enabling DEBUG logging level in ensemble stitching logs in Platform Services Tile

book

Article ID: 442702

calendar_today

Updated On:

Products

VMware Tanzu Platform VMware Tanzu Platform - Cloud Foundry VMware Tanzu Platform - Hub VMware Tanzu Platform Core

Issue/Introduction

This article outlines the steps to enable DEBUG logging level for ensemble stitching logs in Platform Services Tile

Environment

Platform Services 
Tanzu Platform - Hub 
Tanzu Platform for Cloud Foundry

Cause

In scenarios like org group creation failures enabling the DEBUG logs for ensemble stitching services will be helpful to troubleshoot further

Resolution

Since the PS tile deploys the stitching service as a BOSH VM managed by BOSH Process Manager (BPM), you can SSH directly into the VM, edit the start script, and restart the process via monit.

Step 1: SSH into the Stitching VM
First, target your BOSH director and SSH into the ensemble_stitching instance group:
# List VMs to identify the exact deployment name

bosh -e <your-env> deployments

# SSH into the ensemble-stitching VM

bosh -e <your-env> -d <ps-tile-deployment-name> ssh ensemble_stitching/0

Step 2: Elevate to Root
Once inside the VM, switch to the root user:

Step 3: Edit the Server Start Script
Open the BOSH job's executable wrapper script in vi or nano:

Add the environment variables DEBUG=1LOG_LEVEL=debug, and ENSEMBLE_LOG_LEVEL=debug right before npm run start-prod:

#!/bin/bash
cd /var/vcap/packages/ensemble-stitching
export GATEWAY_CONFIG_FILE="/var/vcap/jobs/ensemble-stitching/config/gateway_config.yaml"
export FF_CONFIG_FILE="/var/vcap/jobs/ensemble-stitching/config/ff_config.json"
export SELF_MANAGED_DEPLOYMENT=true
export PATH="/var/vcap/packages/node/bin:$PATH"
export NODE_OPTS=" --heapsnapshot-signal=SIGUSR2 --diagnostic-dir=/var/vcap/jobs/ensemble-stitching/heap-dump --max-old-space-size=750 --trace-gc --trace-gc-ignore-scavenger --optimize_for_size"
# Add debugging env vars here:
export DEBUG=1
export LOG_LEVEL=debug
export ENSEMBLE_LOG_LEVEL=debug
npm run start-prod

Save and exit (:wq).

 Step 4: Restart the Process
Restart the ensemble-stitching job so BPM picks up the script modifications:

monit restart ensemble-stitching

(Alternatively, you can use BPM directly: /var/vcap/packages/bpm/bin/bpm restart ensemble-stitching)

Step 5: Tail the Logs
Monitor the stdout log file on the VM to see all GraphQL-to-REST HTTP fetch queries:

tail -f /var/vcap/sys/log/ensemble-stitching/ensemble-stitching.stdout.log

Once the logs are collected revert the logging level to original by removing the environment variables set in step 3