ari-pino-logging
Pino structured logging patterns for ARI
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Pino structured logging patterns for ARI
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Discord slash commands, approval routing, channel policy, button interaction patterns for OpenClaw/ARI Discord integration
Obsidian vault integration patterns — vault-analyzer.ts, /ari-vault-* commands, morning briefing snippet, PARA structure, read-only enforcement
OpenClaw plugin development patterns — hooks, manifest structure, plugin SDK, APEX/CODEX enforcement
NOVA's P1 PayThePryce pipeline — market signal ingest, card detection, price monitoring, script generation, thumbnail generation, video assembly, approval gate
CHASE's P2 Pryceless Solutions pipeline — lead discovery, 5-criteria audit, LLM qualification, Prompt Forge 4-pass lock, demo generation, outreach approval gate
NOVA's thumbnail generation pipeline — Ideogram V3 via Fal.ai (primary) + DALL-E 3 fallback, 4-variant strategy, Pokemon TCG copyright rules,
| name | ari-pino-logging |
| description | Pino structured logging patterns for ARI |
| triggers | ["logging","pino logger","log format","structured logs"] |
Structured logging with Pino for ARI's observability and debugging needs.
// src/kernel/logger.ts
import pino from 'pino';
export const logger = pino({
level: process.env.ARI_LOG_LEVEL || 'info',
transport: {
target: 'pino-pretty',
options: {
colorize: true,
translateTime: 'SYS:standard',
ignore: 'pid,hostname'
}
}
});
| Level | When to Use |
|---|---|
fatal | System crash, unrecoverable |
error | Operation failed, needs attention |
warn | Unexpected but handled |
info | Normal operations (default) |
debug | Development details |
trace | Very detailed tracing |
logger.info({
event: 'request_received',
method: 'POST',
path: '/message',
requestId: 'uuid',
trustLevel: 'STANDARD'
}, 'Incoming request');
logger.warn({
event: 'injection_detected',
category: 'sql',
riskScore: 0.65,
source: 'gateway'
}, 'Potential injection attempt');
logger.info({
event: 'agent_task',
agent: 'planner',
taskId: 'uuid',
action: 'decompose'
}, 'Agent processing task');
logger.error({
event: 'operation_failed',
error: error.message,
stack: error.stack,
context: { taskId, agent }
}, 'Operation failed');
Create context-specific loggers:
// Per-agent logger
const guardianLogger = logger.child({ agent: 'guardian' });
guardianLogger.info({ risk: 0.3 }, 'Threat assessment complete');
// Per-request logger
const requestLogger = logger.child({ requestId: 'uuid' });
requestLogger.info('Processing started');
Pino logs and audit trail serve different purposes:
| Pino Logs | Audit Trail |
|---|---|
| Operational debugging | Legal compliance |
| Can be rotated | Immutable forever |
| Human readable | Hash-chained |
| Debug/development | Security evidence |
// Log for debugging
logger.debug({ taskId }, 'Task starting');
// Audit for compliance
eventBus.emit('audit:log', {
action: 'task_started',
taskId,
timestamp: new Date().toISOString()
});
Pino is designed for high performance:
// Use lazy evaluation for expensive operations
logger.debug({
data: () => expensiveComputation()
}, 'Debug data');
// Avoid in hot paths
if (logger.isLevelEnabled('trace')) {
logger.trace({ details: getDetails() }, 'Trace');
}
// Production: JSON output, no pretty printing
const logger = pino({
level: 'info',
formatters: {
level: (label) => ({ level: label })
},
timestamp: pino.stdTimeFunctions.isoTime
});