Skip to main content

Synopsis

View and search the operation journal (audit log).

Description

The journal is an append-only log of all ChameleonDB operations. It provides:
  • Complete audit trail - Every operation is logged
  • Daily rotation - Stored in .chameleon/journal/ with date-based files
  • Never deleted - Append-only, immutable history
  • Multiple formats - Table or JSON output
Use the journal to:
  • Audit database changes
  • Debug migration issues
  • Track schema evolution
  • Monitor operation performance

Subcommands

Global Flags

string
default:"table"
Output format: table or json

journal last

Show the most recent journal entries.

Synopsis

Arguments

number
default:"10"
Number of entries to show

Flags

number
default:"10"
Number of entries to show (alternative to positional arg)

Examples

Last 10 Entries (Default)

Output:

Last 20 Entries

JSON Format

Output:

journal errors

Show error operations from today’s journal.

Synopsis

Examples

No Errors

Output:

Errors Found

Output:

JSON Format

Output:

journal migrations

Show migration history from the journal.

Synopsis

Examples

Migration History

Output:

No Migrations Yet

Output:

JSON Format

Output:

journal schema

View schema version history from the Schema Vault.

Synopsis

Arguments

string
Specific version to view details for (e.g., v001, v002)If omitted, shows all versions.

Examples

All Versions

Output:

Specific Version

Output:

No Vault Found

Output:

Version Not Found

Output:

Journal File Structure

Location

Format

Each log entry is JSON:

Daily Rotation

  • New file created daily
  • Old files never deleted (append-only)
  • Date format: YYYY-MM-DD.log

Common Use Cases

Debug Failed Migration

Audit Schema Changes

Monitor Performance

Track User Activity

Integration Examples

Export to CSV

Alert on Errors

Daily Report

Troubleshooting

No Journal Entries

Reason: No operations have been performed yet. Solution: Run a migration or other command:

Cannot Read Journal

Solution: Ensure permissions:

Journal File Corrupted

If a journal file is corrupted (invalid JSON), the command may fail. Recovery:
  1. Identify corrupted file:
  2. Move to backup:
  3. Create empty file:

See Also