Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

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)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

# 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.

Usage

bash
b2c logs list

Flags

FlagDescriptionDefault
--filter, -fFilter by log prefix (can specify multiple)All logs
--sortSort field: name, date, sizedate
--order, -oSort order: asc, descdesc
--jsonOutput as JSONfalse

Examples

bash
# List all log files
b2c logs list

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

# 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)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

# 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

Released under the Apache-2.0 License.