/b2c-cli:b2c-logsfrom b2c-cli
Retrieves and searches logs from Salesforce B2C Commerce instances via the b2c CLI. Supports filtering by time, log level, and text search with structured JSON output.
Ships in b2c-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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).
The CLI auto-discovers the target instance and credentials from SFCC_* environment variables (including project .env), the selected project-local or shared dw.json, and configuration plugins. package.json supplies only non-sensitive defaults. Flags like --server, --client-id, --client-secret, --username, and --password are usually unnecessary — only pass them to override what's auto-detected.
With only a server configured, the first command opens a browser for the user to sign in with their Account Manager account and waits until they do; tell the user to finish signing in. Their Business Manager roles decide access, and a 403 names the missing permission (for example WebDAV_Manage_Customization for Cartridges).
Run b2c setup inspect to see the resolved configuration and which source provided each value (use --json for scripting; secrets stay masked by default). For precedence rules and troubleshooting, see the b2c-cli:b2c-config skill.
The logs get command is optimized for coding agents:
--json for structured output# Get last 20 entries from error and customerror logs (default)
b2c logs get
# Get last 50 entries
b2c logs get --count 50
# JSON output for programmatic parsing
b2c logs get --json
# Entries from the last 5 minutes
b2c logs get --since 5m
# Entries from the last 1 hour
b2c logs get --since 1h
# Entries from the last 2 days
b2c logs get --since 2d
# Entries after a specific time (ISO 8601)
b2c logs get --since "2026-01-25T10:00:00"
# Only ERROR level entries
b2c logs get --level ERROR
# ERROR and FATAL entries
b2c logs get --level ERROR --level FATAL
# Search for "OrderMgr" in messages
b2c logs get --search OrderMgr
# Search for payment errors
b2c logs get --search "PaymentProcessor"
# Recent errors containing "PaymentProcessor"
b2c logs get --since 1h --level ERROR --search "PaymentProcessor" --json
# Last hour of errors and fatals from specific log types
b2c logs get --filter error --filter warn --since 1h --level ERROR --level FATAL
# List all log files
b2c logs list
# List specific log types
b2c logs list --filter error --filter customerror
# List logs in a subdirectory (path-like filter)
b2c logs list --filter internal/server
# JSON output
b2c logs list --json
For interactive log monitoring (not for agents):
# Tail error and customerror logs
b2c logs tail
# Tail specific log types
b2c logs tail --filter debug --filter error
# Tail only ERROR and FATAL level 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"
# Stop with Ctrl+C
To download the complete log file, use the file field from the JSON output with b2c-cli:b2c-webdav:
b2c webdav get error-odspod-0-appserver-20260126.log --root=logs -o -
When using --json, logs get returns:
{
"count": 1,
"entries": [
{
"file": "error-odspod-0-appserver-20260126.log",
"timestamp": "2026-01-26 04:38:03.022 GMT",
"level": "ERROR",
"message": "PipelineCallServlet|156679877|Sites-Site|...",
"raw": "[2026-01-26 04:38:03.022 GMT] ERROR PipelineCallServlet|..."
}
]
}
| Field | Description |
|---|---|
file | Source log file name (use with b2c-cli:b2c-webdav to download full file) |
level | Log level: ERROR, WARN, INFO, DEBUG, FATAL, TRACE |
timestamp | Entry timestamp |
message | Log message (paths normalized for IDE click-to-open) |
raw | Raw unprocessed log line |
Common log file prefixes:
| Prefix | Description |
|---|---|
error | System errors |
customerror | Custom script errors (Logger.error()) |
warn | Warnings |
debug | Debug output (when enabled) |
info | Informational messages |
jobs | Job execution logs |
api | API problems and violations |
deprecation | Deprecated API usage |
quota | Quota warnings |
The prefixes above are the built-in log files. In addition, any script that logs through a custom logger category writes to its own dedicated file with a custom- prefix — distinct from customerror. Integration and job code (payment gateways, ERP/OMS/CRM syncs, feed and import jobs) almost always logs this way, so the entry you need for a triage is frequently in a custom-* file, not in error/customerror.
Custom log file names follow this pattern:
custom-<prefix>-<hostname>-appserver-<date>.log
The <prefix> segment is the first argument passed to Logger.getLogger(prefix, category) in the emitting code, so it maps a log file straight back to the code that wrote it:
| Code | Log file | Filter to read it |
|---|---|---|
Logger.getLogger('PaymentProcessor', 'payment') | custom-PaymentProcessor-*.log | --filter custom-PaymentProcessor |
Logger.getLogger('PimTaxImport', 'tax') | custom-PimTaxImport-*.log | --filter custom-PimTaxImport |
Logger.getLogger('orderexport', 'export') | custom-orderexport-*.log | --filter custom-orderexport |
(The second argument is the log category, used for configuration; it does not appear in the file name.) For the authoring side — how to create these loggers — see the b2c:b2c-logging skill.
Note:
--filterdoes a prefix (starts-with) match on a file's log category, not an exact match — so--filter custom-sweeps everycustom-*file, and--filter custom-Paymentalso matchescustom-PaymentProcessor. The filter also matches the start of the file name. The category stops at the second dash, so a file namedcustom-payment-gateway-*.loghas the categorycustom-payment, but--filter custom-payment-gatewaystill selects it by file name. To read one specific custom log, filter on its logger name (e.g.--filter custom-PimTaxImport); to sweep them all, use--filter custom-.--filterreplaces the defaulterror/customerrorset rather than adding to it, and whenb2c logs getfinds no entries it lists thecustom-*logs that exist.
Because custom log files are not covered by the default error/customerror retrieval, discover them explicitly when investigating an integration or job:
# 1. Enumerate all log files, or narrow to just custom ones
b2c logs list
b2c logs list --filter custom
# 2. Scan the output for an unfamiliar custom-* prefix whose size or
# last-modified time grew when the incident started, then read it
b2c logs get --filter custom-PimTaxImport --since 1h
# 3. Read all custom logs at once when you don't yet know the prefix
b2c logs get --filter custom-
b2c logs list reports each file with its size and last-modified timestamp, which is the fastest way to spot the custom logger that lit up during an incident. Once you have the prefix, --filter custom-<prefix> (or a bare --filter custom- to sweep them all) reads the entries.
If logs list output is incomplete or you want to confirm the raw *.log filenames on the instance, fall back to WebDAV:
# Enumerate log filenames directly over WebDAV
b2c webdav ls --root logs
The Logs/ directory contains subdirectories such as internal/ (e.g. server, ccp, health, csrf-violations, internalquota). These are not listed by default. To reach them, pass a path-like --filter (one containing a /): the tooling then recurses into that subdirectory and matches files by their path relative to Logs/.
# All "server" logs under internal/
b2c logs list --filter internal/server
# Everything under internal/ (trailing slash)
b2c logs tail --filter internal/
# Mix a subdirectory filter with normal prefix filters
b2c logs get --filter error --filter internal/server
This works the same across logs list, logs get, and logs tail (and the equivalent MCP tools).
See b2c logs --help for all available commands and options.
b2c-cli:b2c-webdav - Direct WebDAV file access for downloading full log filesb2c-cli:b2c-config - Verify configuration and credentialsb2c:b2c-logging - Authoring side: how server-side code creates custom logger categories that produce custom-* log filesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin b2c-cli28 skills in this plugin
/b2c-amManage Account Manager resources including API clients, users, roles, and organizations. Use this skill whenever the user needs to create or update API clients, onboard or offboard developers, assign Account Manager roles scoped to tenants, audit user permissions, look up organizations, or provision API clients for CI/CD pipelines. Also use when managing AM role assignments or querying Account Manager data — even if they just say "add a new developer" or "set up an API client". For instance-level Business Manager administration (BM roles, BM users, BM access keys, BM whoami), defer to the `b2c-cli:b2c-bm-users-roles` skill./b2c-bm-users-rolesManage Business Manager users, access roles, role permissions, and per-user access keys on a B2C Commerce instance using the b2c CLI. Use this skill whenever the user needs to list or search BM users on a sandbox or production instance, identify which BM user an OAuth token resolves to ("whoami"), assign or revoke instance-level access roles, edit role permissions, look up a user's WebDAV / OCAPI / Storefront access key, or rotate access keys for SSO-managed users. Also use when the user asks "what's my BM login on sandbox X", "rotate my WebDAV password", "how do I make a custom BM role", "audit BM users on this instance", or "delete a stale BM user from a sandbox"./b2c-capManage Commerce App Packages (CAPs), also called commerce apps or apps, and commerce features using the b2c CLI. Use this skill whenever the user needs to validate, package, install, uninstall, list, or pull commerce apps on B2C Commerce instances, view configuration tasks, or pull app sources for cartridge deployment or Storefront Next development. Also use when checking which apps are installed on an instance, inspecting app details or versions, or managing app lifecycle — even if they just say "what apps do I have", "list my commerce apps", "which CAPs are installed", "install this app", "pull app sources", or "show installed apps"./b2c-cipQuery CIP/CCAC sales, merchandising, payment, traffic, and API/controller analytics with the B2C CLI or MCP. Discover reports/tables, scope SQL, export results, and resolve analytics access./b2c-codeDeploy, download, and manage cartridge code versions on B2C Commerce instances. Use this skill whenever the user needs to upload or download cartridges to/from a sandbox, activate or delete code versions, watch for local file changes during development, or deploy a subset of cartridges. Also use when pushing code to an instance, pulling code from an instance, or setting up a dev workflow with live reload -- even if they just say 'push my code to the sandbox', 'download the code', or 'how do I activate the new version'./b2c-configConfigure B2C CLI/MCP authentication, instances, and project defaults; troubleshoot missing credentials, wrong targets, or configuration precedence. Routine inspection can use config_inspect or b2c setup inspect directly.Other plugins' skills for the same job