Session logging
Enable logs: true when constructing DNotifier to send AI session telemetry to the DNotifier dashboard — session start, completion, and token usage for each sendAI call.
What gets logged
When logging is enabled and you call sendAI:
Session start
Before the AI request is sent
Session complete
After the HTTP response returns (or WS AI reply for WebSocket)
Token usage
Extracted from response when available
Model
From sendAI / agent model when set; otherwise project default (current_model)
View sessions in the dashboard under Logs — see Dashboard overview.
Enable logging
Pass logs: true at construction time (not per sendAI call):
const notifier = new DNotifier({
appId: process.env.DNOTIFIER_APP_ID,
secret: process.env.DNOTIFIER_SECRET,
transport: "http",
userId: "user-123",
logs: true,
onConnected: () => {},
onMessage: () => {},
onDisconnected: () => {},
});Logging vs AI history
Feature
logs: true
saveHistory on sendAI
Purpose
Ops dashboard, token audit
User-facing conversation storage
API
Automatic on sendAI
fetchAIHistory to read
Audience
Developers / support leads
End-user chat UI
Use both in production: history for the product, logs for operations.
Workflow observability
AI calls inside workflows use a separate mechanism — workflow observability (observability: true on Workflow). See Workflow observability.
Language guides
JavaScript / TypeScript
Dart / Flutter
Next steps
Dashboard overview — Where logs appear
AI sessions —
sessionIdcontinuation
Last updated