Skip to content
Back to skills

1916 Audit Log 6ca91f53

ASecurity

Implement database audit logging

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
databasessqldebuggingdatabase

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 1916-audit-log_6ca91f53 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 1916 Audit Log 6ca91f53?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 1916 Audit Log 6ca91f53
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-1916-audit-log-6ca91f53/badge)](https://www.skillsdirectory.com/skills/tools-only-1916-audit-log-6ca91f53)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: audit-log
description: Implement database audit logging
---
# Database Audit Logger

Track database changes for compliance and debugging.

## Audit Strategies

1. **Trigger-Based**: Database triggers on INSERT/UPDATE/DELETE
2. **Application-Level**: Log in application code
3. **CDC (Change Data Capture)**: Stream changes
4. **Database Logs**: Parse database transaction logs

## Audit Table Template

```sql
CREATE TABLE audit_log (
  id SERIAL PRIMARY KEY,
  table_name VARCHAR(100) NOT NULL,
  operation VARCHAR(10) NOT NULL,
  old_data JSONB,
  new_data JSONB,
  user_id INTEGER,
  timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Trigger example
CREATE OR REPLACE FUNCTION audit_trigger()
RETURNS TRIGGER AS $$
BEGIN
  INSERT INTO audit_log (table_name, operation, old_data, new_data)
  VALUES (TG_TABLE_NAME, TG_OP, row_to_json(OLD), row_to_json(NEW));
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;
```

## When Invoked

Generate audit logging implementation for compliance tracking.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.