Install AI Tools

B2C Commerce tools, documentation, and skills for your assistant.

Claude

Install the plugin Recommended

bash
claude plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
claude plugin install b2c-dx-mcp@b2c-developer-tooling

Start a new Claude Code session. To install for the current project only, run it from your project directory with --scope project.

Manual MCP setup
bash
claude mcp add --transport stdio --scope user b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new session. To configure the current project only, run it from your project directory with --scope project. See Claude Code MCP setup.

Claude Desktop setup

Codex

Install the plugin Recommended

bash
codex plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
codex plugin add b2c-dx-mcp@b2c-developer-tooling

Start a new Codex session in your project. This setup also works with the Codex IDE extension and the ChatGPT Work desktop app.

Manual MCP setup
bash
codex mcp add b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Or add this to ~/.codex/config.toml (or $CODEX_HOME/config.toml if customized):

toml
[mcp_servers.b2c-dx-mcp]
command = "npx"
args = ["-y", "@salesforce/b2c-dx-mcp@latest"]

Start a new session. See Codex MCP configuration.

ChatGPT online setup

VS Code

Install the plugin Recommended

  1. Open the Command Palette (Cmd/Ctrl+Shift+P) and run Chat: Install Plugin from Source.
  2. Enter SalesforceCommerceCloud/b2c-developer-tooling.
  3. Select b2c-dx-mcp and follow the installation prompts.
  4. Start a new chat in GitHub Copilot.
Manual MCP setup

Add this to .vscode/mcp.json in your workspace:

json
{
  "servers": {
    "b2c-dx-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

See VS Code MCP setup.

Copilot CLI setup

Cursor

Reload the MCP server in Cursor after installation.

Manual MCP setup

Add this to .cursor/mcp.json in your project:

json
{
  "mcpServers": {
    "b2c-dx-mcp": {
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

For all projects, use ~/.cursor/mcp.json instead.

See Cursor's MCP documentation.

OpenCode

Add this to opencode.json in your project:

json
{
  "mcp": {
    "b2c-dx-mcp": {
      "type": "local",
      "command": ["npx", "-y", "@salesforce/b2c-dx-mcp@latest"],
      "enabled": true
    }
  }
}

Restart OpenCode. For all projects, use ~/.config/opencode/opencode.json. See OpenCode MCP setup.

Gemini

Run:

bash
gemini mcp add --scope user b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new Gemini CLI session. To configure the current project only, run it from your project directory with --scope project. See Gemini CLI MCP setup.

No separate skills plugins needed.

Other clients and manual setup →
Skip to content
View as Markdown
View as Markdown

Logs Commands ​

Commands for retrieving and monitoring log files on B2C Commerce instances. These commands provide convenient access to instance logs without needing to manually navigate WebDAV.

Authentication ​

All logs commands require WebDAV credentials. See the WebDAV Authentication section for details on Basic Auth and OAuth options.


b2c logs get ​

Get recent log entries from a B2C Commerce instance. This command is designed for one-shot log retrieval with filtering options, suitable for both human use and programmatic/agent access.

Usage ​

bash
b2c logs get

Flags ​

FlagDescriptionDefault
--filter, -fLog prefixes to filter (can specify multiple). Use a path like internal/server to fetch logs from a subdirectory.error, customerror
--count, -nMaximum number of entries to retrieve20
--sinceOnly show entries after this time (e.g., "5m", "1h", "2d", or ISO 8601)-
--levelFilter by log level (can specify multiple): ERROR, WARN, INFO, DEBUG, FATAL, TRACE-
--search, -gFilter entries containing this text (case-insensitive)-
--cartridge-pathOverride cartridge path for path normalizationAuto-discovered
--no-normalizeDisable automatic path normalizationfalse
--no-colorDisable colored outputfalse
--jsonOutput as JSONfalse

Examples ​

bash
# Get recent logs (default: error and customerror, last 20 entries)
b2c logs get

# Get more entries
b2c logs get --count 50

# Get logs from specific types
b2c logs get --filter error --filter debug --filter warn

# Get logs from a subdirectory (e.g. internal/) using a path-like filter
b2c logs get --filter internal/server

# Filter by time - last 5 minutes
b2c logs get --since 5m

# Filter by time - last 2 hours
b2c logs get --since 2h

# Filter by time - specific timestamp
b2c logs get --since "2026-01-25T10:00:00"

# Filter by log level
b2c logs get --level ERROR --level FATAL

# Search for specific text
b2c logs get --search "OrderMgr"

# Combined filters with JSON output
b2c logs get --since 1h --level ERROR --search "PaymentProcessor" --json

Output ​

Human-readable output displays entries with colored log levels:

ERROR [2026-01-25 10:30:45.123 GMT] [customerror-blade0-1-appserver-20260125.log]
Error in OrderMgr.placeOrder at /app_storefront/cartridge/scripts/checkout.js:42

WARN [2026-01-25 10:29:12.456 GMT] [error-blade0-1-appserver-20260125.log]
Slow query detected in product search

JSON output (--json) returns:

json
{
  "count": 2,
  "entries": [
    {
      "file": "customerror-blade0-1-appserver-20260125.log",
      "level": "ERROR",
      "timestamp": "2026-01-25 10:30:45.123 GMT",
      "message": "Error in OrderMgr.placeOrder at ./cartridges/app_storefront/cartridge/scripts/checkout.js:42",
      "raw": "[2026-01-25 10:30:45.123 GMT] ERROR ... (full raw line)"
    }
  ]
}

Path Normalization ​

By default, file paths in log messages are converted from server paths to local paths for IDE click-to-open functionality. The command auto-discovers your local cartridge directory structure.

Use --no-normalize to disable this feature, or --cartridge-path to specify a custom cartridge location.


b2c logs list ​

List log files available on a B2C Commerce instance.

B2C CLI filtering custom error logs and showing their sizes and modification times.

Usage ​

bash
b2c logs list

Flags ​

FlagDescriptionDefault
--filter, -fFilter by log prefix (can specify multiple). Use a path like internal/server to list logs in a subdirectory.All logs
--sortSort field: name, date, sizedate
--order, -oSort order: asc, descdesc
--columns, -cColumns to display (comma-separated). Available: name, prefix, size, modified-
--extended, -xShow all columns including extended fieldsfalse
--jsonOutput as JSONfalse

Examples ​

bash
# List all log files
b2c logs list

# List only error logs
b2c logs list --filter error --filter customerror

# List logs in the internal/ subdirectory (path-like filter)
b2c logs list --filter internal/server

# Sort by size
b2c logs list --sort size --order desc

# JSON output
b2c logs list --json

Output ​

Name                                          Type         Size      Modified
────────────────────────────────────────────────────────────────────────────────
error-blade0-1-appserver-20260125.log        error        245.2 KB  1/25/2026, 10:30 AM
customerror-blade0-1-appserver-20260125.log  customerror  128.5 KB  1/25/2026, 10:28 AM
debug-blade0-1-appserver-20260125.log        debug        1.2 MB    1/25/2026, 10:25 AM

b2c logs tail ​

Tail log files in real-time. This is an interactive command that continuously monitors logs until stopped with Ctrl+C.

Usage ​

bash
b2c logs tail

Flags ​

FlagDescriptionDefault
--filter, -fLog prefixes to filter (can specify multiple). Use a path like internal/server to tail logs in a subdirectory.error, customerror
--intervalPolling interval in milliseconds3000
--last, -lShow last N entries per file on startup (0 to skip)1
--levelFilter by log level (can specify multiple): ERROR, WARN, INFO, DEBUG, FATAL, TRACE-
--search, -gFilter entries containing this text (case-insensitive)-
--cartridge-pathOverride cartridge path for path normalizationAuto-discovered
--no-normalizeDisable automatic path normalizationfalse
--no-colorDisable colored outputfalse
--jsonOutput as NDJSON (newline-delimited JSON)false

Examples ​

bash
# Tail error and customerror logs (default)
b2c logs tail

# Tail specific log types
b2c logs tail --filter debug --filter error --filter warn

# Tail a log in the internal/ subdirectory (path-like filter)
b2c logs tail --filter internal/server

# Faster polling (1 second)
b2c logs tail --interval 1000

# Start without showing historical entries
b2c logs tail --last 0

# Show last 5 entries per file on startup
b2c logs tail --last 5

# Tail only ERROR and FATAL entries
b2c logs tail --level ERROR --level FATAL

# Tail with text search
b2c logs tail --search "PaymentProcessor"

# Combined filtering
b2c logs tail --filter customerror --level ERROR --search "OrderMgr"

# NDJSON output for streaming parsers
b2c logs tail --json

Notes ​

  • This is an interactive command that runs until interrupted with Ctrl+C
  • The command discovers and monitors all matching log files, including newly created files during rotation
  • JSON mode outputs NDJSON (one JSON object per line) suitable for streaming parsers
  • For non-interactive log retrieval, use b2c logs get instead

Log File Types ​

B2C Commerce instances generate various log files:

Custom Logs (Script-Generated) ​

TypeGenerated ByDefault State
customdebugLogger.debug()Disabled
custominfoLogger.info()Disabled
customwarnLogger.warn()Always enabled
customerrorLogger.error()Always enabled
customfatallog.fatal()Always enabled

System Logs ​

TypeDescription
errorSystem errors in scripts, templates, platform
warnLock status, slot warnings, servlet warnings
infoSystem information
debugDebug information (when enabled)
fatalCritical system failures
apiAPI problems and violations
deprecationUsage of deprecated APIs
jobsJob status information
quotaQuota warnings and limit violations

Downloading Full Log Files ​

To download the complete log file for deeper investigation, use b2c webdav get with the filename from the log entry (shown in brackets in human output, or the file field in JSON output):

bash
b2c webdav get error-odspod-0-appserver-20260126.log --root=logs -o -

See WebDAV Commands for more details on log file access.


See Also ​