b2c-logs
B2C Logs Skill
Use the b2c CLI to retrieve and monitor log files on Salesforce B2C Commerce instances. The logs get command is designed for agent-friendly, non-interactive log retrieval with structured JSON output.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli logs get).
Configuration & Authentication
The CLI auto-discovers the target instance and credentials from SFCC_* environment variables, dw.json in the current or parent directories, ~/.mobify, package.json, and configuration plugins. Flags like --server, --client-id, --client-secret, --username, and --password are usually unnecessary — only pass them to override what's auto-detected.
Run b2c setup inspect to see the resolved configuration and which source provided each value (use --json for scripting, --unmask to reveal secrets). For precedence rules and troubleshooting, see the b2c-cli:b2c-config skill.
Agent-Friendly Log Retrieval
The logs get command is optimized for coding agents:
- Exits immediately after retrieving logs (non-interactive)
- Supports
--jsonfor structured output - Filters by time, level, and text search
- Auto-normalizes file paths for IDE click-to-open