DEV Community

Qasim Muhammad
Qasim Muhammad

Posted on

nylas audit logs clear â Clear all audit log entries. This is a destructive action â consider exporting logs first with `nyla...

Compliance and debugging both need logs. nylas audit logs clear handles the clear all audit log entries. this is a destructive action — consider exporting logs first with nylas audit export.

The nylas audit logs clear command permanently deletes all stored audit log entries. This is destructive and cannot be undone.

Syntax

nylas audit logs clear [--force]
Enter fullscreen mode Exit fullscreen mode

Examples

Interactive clear (with confirmation):

nylas audit logs clear
Enter fullscreen mode Exit fullscreen mode

Export before clearing:

nylas audit export -o audit-backup.json
nylas audit logs clear --force
Enter fullscreen mode Exit fullscreen mode

How It Works

Every entry in the audit log captures: the exact command, all arguments (with secrets redacted), the invoker identity (human or AI agent name), the exit code, and a nanosecond timestamp. This level of detail is what compliance auditors expect.

Key Flags

Run nylas audit logs clear --help to see all available flags. Add --json for machine-readable output — useful when piping into jq or feeding data to scripts.

nylas audit logs clear --help
Enter fullscreen mode Exit fullscreen mode

Common Issues

Logs not clearing
Check file permissions on the audit log directory. Use nylas audit config show to find the log path.

Related Commands

  • nylas audit init — Initialize audit logging for the Nylas CLI. Creates the log directory, default c
  • nylas audit logs show — View and filter audit log entries. Supports filtering by date range, command, st
  • nylas audit logs summary — View summary statistics of audit log entries including command counts, error rat
  • nylas audit export — Export audit logs to JSON or CSV for compliance, analysis, or backup

Full docs: nylas audit logs clear reference — all flags, advanced examples, and troubleshooting.

All commands: Nylas CLI Command Reference

Get started: brew install nylas/nylas-cli/nylas — other install methods

Top comments (0)