Skip to main content

CONA Logging Guide

All logs are centralized in Axiom for monitoring, debugging, and security analysis.

Quick Reference


Webapp Logging

Server Actions & API Routes

Client Components


Temporal Worker Logging

Already configured ✅ - Temporal workers send logs to Axiom automatically

Activities

Dataset: cona_temporal-workers
Configuration: apps/temporal-workers/src/logger.ts (uses Pino + @axiomhq/pino)

Database Access Logging (Optional)

For sensitive database operations, add context:

Middleware Logging

Automatic - All requests are logged via logMiddlewareRequest(request) Custom security events:

Log Levels

  • info - Normal operations, successful actions
  • warn - Expected issues (auth failures, validation errors)
  • error - Unexpected failures, exceptions

What to Log

Always Include:

✅ Action/operation name
✅ Organization ID (if applicable)
✅ User ID (if applicable)
✅ Success/failure status

Include for Errors:

✅ Error message
✅ Error stack trace
✅ Context (what was being attempted)

Never Log:

❌ Passwords
❌ API keys
❌ Session tokens
❌ Credit card numbers

Viewing Logs

Axiom Dashboard: https://axiom.co/ Datasets:
  • cona_webapp - Web application (middleware, server actions, client)
  • cona_temporal-workers - Temporal workers (workflows, activities)
Query examples:

Security Monitoring

Auth failures are automatically logged:
  • Web page access without session → action: "auth_required"
  • API access without session → action: "api_auth_required"
  • Both include blocked: true flag
Query to detect brute force:

Retention

  • Security events: 12 months
  • Error logs: 6 months
  • Info logs: 3 months

More Info

  • Security Monitoring: docs/axiom-security-monitoring.md
  • Axiom Setup & MCP: Axiom Guide
  • Query Examples: docs/axiom-corrected-queries.md