[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M783TZZX96CQFP712R9FKXP4":3,"skill-same:01M783TZZX96CQFP712R9FKXP4":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M783TZZX96CQFP712R9FKXP4","logging-best-practices",null,"Structured logging with proper levels, context, PII handling, centralized aggregation. Use for application logging, log management integration, distributed tracing, or encountering log bloat, PII exposure, missing context errors.","aibizmod\u002Faibizmod-service-web","aibizmod","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F295315630?v=4","01M7836CB8EQY701YQ7N88M591","01M7836CBVPZGNSJ8BRP2BT398",0,"MIT","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Flogging-best-practices\u002Fskills\u002Flogging-best-practices\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: logging-best-practices\ndescription: Structured logging with proper levels, context, PII handling, centralized aggregation. Use for application logging, log management integration, distributed tracing, or encountering log bloat, PII exposure, missing context errors.\nlicense: MIT\n---\n\n# Logging Best Practices\n\nImplement secure, structured logging with proper levels and context.\n\n## Log Levels\n\n| Level | Use For | Production |\n|-------|---------|------------|\n| DEBUG | Detailed debugging | Off |\n| INFO | Normal operations | On |\n| WARN | Potential issues | On |\n| ERROR | Errors with recovery | On |\n| FATAL | Critical failures | On |\n\n## Structured Logging (Winston)\n\n```javascript\nconst winston = require('winston');\n\nconst logger = winston.createLogger({\n  level: process.env.LOG_LEVEL || 'info',\n  format: winston.format.combine(\n    winston.format.timestamp(),\n    winston.format.json()\n  ),\n  defaultMeta: { service: 'api-service' },\n  transports: [\n    new winston.transports.Console(),\n    new winston.transports.File({ filename: 'error.log', level: 'error' })\n  ]\n});\n\n\u002F\u002F Usage\nlogger.info('User logged in', { userId: '123', ip: '192.168.1.1' });\nlogger.error('Payment failed', { error: err.message, orderId: '456' });\n```\n\n## Request Context\n\n```javascript\nconst { AsyncLocalStorage } = require('async_hooks');\nconst storage = new AsyncLocalStorage();\n\napp.use((req, res, next) => {\n  const context = {\n    requestId: req.headers['x-request-id'] || uuid(),\n    userId: req.user?.id\n  };\n  storage.run(context, next);\n});\n\nfunction log(level, message, meta = {}) {\n  const context = storage.getStore() || {};\n  logger.log(level, message, { ...context, ...meta });\n}\n```\n\n## PII Sanitization\n\n```javascript\nconst sensitiveFields = ['password', 'ssn', 'creditCard', 'token'];\n\nfunction sanitize(obj) {\n  const sanitized = { ...obj };\n  for (const field of sensitiveFields) {\n    if (sanitized[field]) sanitized[field] = '[REDACTED]';\n  }\n  if (sanitized.email) {\n    sanitized.email = sanitized.email.replace(\u002F(.{2}).*@\u002F, '$1***@');\n  }\n  return sanitized;\n}\n```\n\n## Best Practices\n\n- Use structured JSON format\n- Include correlation IDs across services\n- Sanitize all PII before logging\n- Use async logging for performance\n- Implement log rotation\n- Never log at DEBUG in production\n\n## Additional Implementations\n\nSee [references\u002Fadvanced-logging.md](references\u002Fadvanced-logging.md) for:\n- Python structlog setup\n- Go zap high-performance logging\n- ELK Stack integration\n- AWS CloudWatch configuration\n- OpenTelemetry tracing\n\n## Never Do\n\n- Log passwords or tokens\n- Use console.log in production\n- Log inside tight loops\n- Include stack traces for client errors\n","# Logging Best Practices\n\nImplement secure, structured logging with proper levels and context.\n\n## Log Levels\n\n| Level | Use For | Production |\n|-------|---------|------------|\n| DEBUG | Detailed debugging | Off |\n| INFO | Normal operations | On |\n| WARN | Potential issues | On |\n| ERROR | Errors with recovery | On |\n| FATAL | Critical failures | On |\n\n## Structured Logging (Winston)\n\n```javascript\nconst winston = require('winston');\n\nconst logger = winston.createLogger({\n  level: process.env.LOG_LEVEL || 'info',\n  format: winston.format.combine(\n    winston.format.timestamp(),\n    winston.format.json()\n  ),\n  defaultMeta: { service: 'api-service' },\n  transports: [\n    new winston.transports.Console(),\n    new winston.transports.File({ filename: 'error.log', level: 'error' })\n  ]\n});\n\n\u002F\u002F Usage\nlogger.info('User logged in', { userId: '123', ip: '192.168.1.1' });\nlogger.error('Payment failed', { error: err.message, orderId: '456' });\n```\n\n## Request Context\n\n```javascript\nconst { AsyncLocalStorage } = require('async_hooks');\nconst storage = new AsyncLocalStorage();\n\napp.use((req, res, next) => {\n  const context = {\n    requestId: req.headers['x-request-id'] || uuid(),\n    userId: req.user?.id\n  };\n  storage.run(context, next);\n});\n\nfunction log(level, message, meta = {}) {\n  const context = storage.getStore() || {};\n  logger.log(level, message, { ...context, ...meta });\n}\n```\n\n## PII Sanitization\n\n```javascript\nconst sensitiveFields = ['password', 'ssn', 'creditCard', 'token'];\n\nfunction sanitize(obj) {\n  const sanitized = { ...obj };\n  for (const field of sensitiveFields) {\n    if (sanitized[field]) sanitized[field] = '[REDACTED]';\n  }\n  if (sanitized.email) {\n    sanitized.email = sanitized.email.replace(\u002F(.{2}).*@\u002F, '$1***@');\n  }\n  return sanitized;\n}\n```\n\n## Best Practices\n\n- Use structured JSON format\n- Include correlation IDs across services\n- Sanitize all PII before logging\n- Use async logging for performance\n- Implement log rotation\n- Never log at DEBUG in production\n\n## Additional Implementations\n\nSee [references\u002Fadvanced-logging.md](references\u002Fadvanced-logging.md) for:\n- Python structlog setup\n- Go zap high-performance logging\n- ELK Stack integration\n- AWS CloudWatch configuration\n- OpenTelemetry tracing\n\n## Never Do\n\n- Log passwords or tokens\n- Use console.log in production\n- Log inside tight loops\n- Include stack traces for client errors\n",{"name":5,"license":14,"description":7},"main","9f54582c8b485462d402d7e70feaef34801746b9",".opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Flogging-best-practices\u002Fskills\u002Flogging-best-practices","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web","https:\u002F\u002Fgithub.com\u002Faibizmod","2026-09-24 00:48:11",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add aibizmod\u002Faibizmod-service-web --skill logging-best-practices",{"tool":35,"command":36},"bunx","bunx skills add aibizmod\u002Faibizmod-service-web --skill logging-best-practices",{"tool":38,"command":39},"pnpm","pnpm dlx skills add aibizmod\u002Faibizmod-service-web --skill logging-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Flogging-best-practices\u002Fskills\u002Flogging-best-practices\u002FSKILL.md",true,[43],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"references\u002Fadvanced-logging.md","REFERENCE","参考文档",6580,"https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Flogging-best-practices\u002Fskills\u002Flogging-best-practices\u002Freferences\u002Fadvanced-logging.md",[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":18},"01M7846EAPZWCQ8C6G3AAMMR57","{TODO=lowercase-hyphen-case-name}","[TODO: Write comprehensive description in third-person. Start with \"This skill provides...\" or \"This skill should be used when...\"]\n\n[TODO: Add \"Use when\" scenarios - specific situations where Claude should use this skill]\n\n[TODO: Add keywords - technologies, use cases, error messages that should trigger this skill]","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Ftemplates\u002Fskill-skeleton\u002Fskills\u002Fskill-name\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M7846A0WGDKJTDPD5QMHQVFV","zustand-state-management","Zustand state management for React with TypeScript. Use for global state, Redux\u002FContext API migration, localStorage persistence, slices pattern, devtools, Next.js SSR, or encountering hydration errors, TypeScript inference issues, persist middleware problems, infinite render loops.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fzustand-state-management\u002Fskills\u002Fzustand-state-management\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M78463GGSP9B3JSF146B2MG0","zod","TypeScript-first schema validation and type inference. Use for validating API requests\u002Fresponses, form data, env vars, configs, defining type-safe schemas with runtime validation, transforming data, generating JSON Schema for OpenAPI\u002FAI, or encountering missing validation errors, type inference issues, validation error handling problems. Zero dependencies (2kb gzipped).","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fzod\u002Fskills\u002Fzod\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7845ZX17SVNNY7EDGPJHSBT","xss-prevention","XSS attack prevention with input sanitization, output encoding, Content Security Policy. Use for user-generated content, rich text editors, web application security, or encountering stored XSS, reflected XSS, DOM manipulation, script injection errors.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fxss-prevention\u002Fskills\u002Fxss-prevention\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7845ST1H37YHSXWWQ9N0V0S","wordpress-plugin-core","WordPress plugin development with hooks, security, REST API, custom post types. Use for plugin creation, $wpdb queries, Settings API, or encountering SQL injection, XSS, CSRF, nonce errors.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fwordpress-plugin-core\u002Fskills\u002Fwordpress-plugin-core\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7845PTWD5HWSTGP35Q8TFNY","woocommerce-dev-cycle","Run tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow in WooCommerce projects.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fwoocommerce-dev-cycle\u002Fskills\u002Fwoocommerce-dev-cycle\u002FSKILL.md",[],[]]