[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79ABDJQ4APNNY5QK4HM5X4F":3,"skill-same:01M79ABDJQ4APNNY5QK4HM5X4F":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M79ABDJQ4APNNY5QK4HM5X4F","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.","Elogic360\u002Fsoftware-factory","Elogic360","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F156535519?v=4","01M74NH3F0RB13PWB7JZDE2V80","elogic360","01M74NH3FPC65082MDZVMFHDM3",0,"MIT","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\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":15,"description":7},"main","c475fc64e94e803b50d14a791dfee8853fbb2c5c","integrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Flogging-best-practices\u002Fskills\u002Flogging-best-practices","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory","https:\u002F\u002Fgithub.com\u002FElogic360","2026-11-08 22:21:22",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add Elogic360\u002Fsoftware-factory --skill logging-best-practices",{"tool":36,"command":37},"bunx","bunx skills add Elogic360\u002Fsoftware-factory --skill logging-best-practices",{"tool":39,"command":40},"pnpm","pnpm dlx skills add Elogic360\u002Fsoftware-factory --skill logging-best-practices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Flogging-best-practices\u002Fskills\u002Flogging-best-practices\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"references\u002Fadvanced-logging.md","REFERENCE","参考文档",6580,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Flogging-best-practices\u002Fskills\u002Flogging-best-practices\u002Freferences\u002Fadvanced-logging.md",[51,59,66,73,80,87],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M79G206MT3J6S0GY3C45P2KV","vss-summarize-video","Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-summarize-video\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M79G1WN63PGRE8CKD47WEBQ5","vss-setup-video-analytics-api","Use to deploy the vss-video-analytics-api REST service standalone (config-source, data-log bind, Elasticsearch, optional Kafka). Not for full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-video-analytics-api\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M79G1S9F7VY3EF6H53PRP5AN","vss-setup-behavior-analytics","Use to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration). Not for the full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-behavior-analytics\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M79G1N1S1Y27PFZPYMNK1MTQ","vss-search-archive","Use this skill to run top-level VSS fusion search on archived video, or to ingest video files \u002F RTSP streams for search. Do NOT use for ad-hoc visual Q&A (use vss-ask-video), live captioning (use vss-deploy-dense-captioning), or video summarization and reports (use vss-summarize-video).","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-search-archive\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M79G1H6WN0Q6C0VCAXCZX6B7","vss-query-analytics","Use this skill when reading video-analytics metrics, incidents, alerts, and sensor data via the VA-MCP server (port 9901). Not for live VLM or incident-range narrative reports.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-query-analytics\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M79G1DYPNXQS7QHZ0AAF5FX5","vss-manage-video-io-storage","Use to call the VIOS REST API (sensor list, timelines, clip extraction, snapshots, add\u002Fdelete sensors and streams). Not for VLM inference or search.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-manage-video-io-storage\u002FSKILL.md",[],[]]