This document explains how to configure debug logging for the lesson workflow system.
The debug logging is controlled by the DEBUG_LESSON_WORKFLOW environment variable.
- Enable:
true,1,yes(case-insensitive) - Disable:
false,0,no(case-insensitive), or omit the variable
# Enable debug logging
DEBUG_LESSON_WORKFLOW=true
DEBUG_LESSON_WORKFLOW=1
DEBUG_LESSON_WORKFLOW=yes
# Disable debug logging
DEBUG_LESSON_WORKFLOW=false
DEBUG_LESSON_WORKFLOW=0
DEBUG_LESSON_WORKFLOW=no
# Or simply don't set the variableCreate a .env file in the project root with:
DEBUG_LESSON_WORKFLOW=trueexport DEBUG_LESSON_WORKFLOW=true
python main.py- Go to your App Service in Azure Portal
- Navigate to Settings → Configuration
- Under Application settings, add:
- Name:
DEBUG_LESSON_WORKFLOW - Value:
true(orfalseto disable)
- Name:
- Click Save
az webapp config appsettings set \
--name your-app-name \
--resource-group your-resource-group \
--settings DEBUG_LESSON_WORKFLOW=true- Azure App Service Configuration (highest priority)
- .env file (if present)
- Default value (false)
When DEBUG_LESSON_WORKFLOW=true, the system logs:
- Which robot is being processed
- Number of connected audio clients
- Whether audio client is connected
- Which audio path is taken (audio client vs frontend)
- Content index and text preview
- Message direction (SEND/RECEIVE)
- Message type
- Target client
- Reason for routing decision
- State changes
- Transition triggers
- Robot context
- When disabled: Zero performance impact - no debug logging occurs
- When enabled: Minimal performance impact - only logs when debug is enabled
- Production recommendation: Keep disabled unless debugging specific issues
Run the test script to verify debug logging is working:
# Test with debug enabled
DEBUG_LESSON_WORKFLOW=true python test_debug_logging.py
# Test with debug disabled
DEBUG_LESSON_WORKFLOW=false python test_debug_logging.py- Check if
DEBUG_LESSON_WORKFLOWis set correctly - Verify the environment variable is loaded (check logs for config loading)
- Ensure the app has been restarted after changing the setting
- Set
DEBUG_LESSON_WORKFLOW=falseto disable - Or modify the logging level in your logging configuration