sfcc-logging

Implement consistent logging in SFCC scripts using Logger and Log APIs.

27|9|Updated Aug 8, 2025
One-click install
npx skills add https://github.com/taurgis/sfcc-dev-mcp --skill sfcc-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sfcc-logging
Source: https://github.com/taurgis/sfcc-dev-mcp/tree/main/ai-instructions/skills/sfcc-logging
Command: npx skills add https://github.com/taurgis/sfcc-dev-mcp --skill sfcc-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SFCC developers often struggle to troubleshoot issues across scripts without a standardized logging approach. This guide provides a structured way to implement and use SFCC's Logger and Log APIs, improving observability and debuggability across cartridges.

Core Features & Use Cases

  • Static logging with dw/system Logger for quick, global messages.
  • Instance-based logging with Logger.getLogger and Log for categorized, context-rich messages.
  • Nested Diagnostic Context (NDC) to correlate related log entries.
  • Custom named log files and per-category settings guided by Business Manager configuration.
  • Best practices, category strategies, and safe handling to avoid exposing sensitive data.

Quick Start

Follow the guidelines to instrument your SFCC cartridges with Logger and Log-based logging, and begin using categories and NDC today.

Frequently Asked Questions about sfcc-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement consistent logging across SFCC cartridges?

Consistent SFCC logging is implemented using the dw/system Logger for static messages and Log for instance-based categorized entries. This approach standardizes observability across cartridges by applying defined log levels, categories, and Business Manager configurations.

What is the difference between static Logger and instance-based Log in SFCC?

Static Logger usage provides quick global messages in SFCC, while instance-based Log via getLogger enables categorized, context-rich entries. Instance logging allows custom named log files and per-category settings configured through Business Manager.

How do I use NDC tracing to correlate related log entries in SFCC scripts?

NDC tracing in SFCC correlates related log entries by pushing contextual information onto a nested diagnostic context stack. This nested context attaches to subsequent log messages, enabling you to trace execution flow across script boundaries.

Can I configure custom log file names and per-category settings in Business Manager?

Yes, SFCC Business Manager supports custom named log files and per-category settings for instance-based logging. You configure log levels and categories within Business Manager to control output destinations and verbosity for specific cartridge components.

What are the best practices for handling sensitive data in SFCC log messages?

Best practices for SFCC logging involve avoiding the exposure of sensitive data in log entries. You should sanitize or omit personal identifiable information before passing messages to Logger or Log APIs, ensuring compliance with data protection standards.