Skip to content

[FEATURE]: Implement Persistent Audit Logging #8

Description

@amaan1114

Feature Summary

Implement a persistent audit logging system to record important user and workflow actions in the database. While AsyncNode currently uses Winston for application logging, there is no centralized audit trail for tracking user activity or administrative actions.


Problem Statement

AsyncNode currently relies on Winston for application and error logging, which is primarily intended for debugging and infrastructure monitoring.

However, there is no persistent audit logging system that records user or workflow activities in the database.

Without audit logs:

  • User actions cannot be traced over time.
  • Administrative changes are not recorded.
  • Historical activity cannot be reviewed.
  • Future features such as activity history, admin dashboards, and security auditing cannot be implemented effectively.

Proposed Solution

Implement a centralized audit logging service that persists audit events to the existing audit_logs table.

The service should automatically create audit entries for important application events, including but not limited to:

  • User authentication events
  • Workflow creation, updates, and deletion
  • Credential creation and updates
  • Other security-sensitive operations

Each audit log should include relevant metadata such as:

  • User ID
  • Action performed
  • Resource type
  • Resource ID
  • Timestamp
  • Additional contextual information (when applicable)

The audit logging service should be reusable across the application and should not interrupt normal request processing if audit logging fails.


Benefits

  • Provides a complete history of important user and system actions.
  • Improves traceability and accountability.
  • Simplifies debugging and incident investigations.
  • Establishes the foundation for future activity feeds and administrative dashboards.
  • Clearly separates operational logging (Winston) from business-level audit logging.

Additional Context

  • Winston should continue to be used for application, error, and infrastructure logging.
  • This feature introduces database-backed audit logs and does not replace the existing logging system.
  • The implementation should reuse the existing audit_logs schema where applicable and follow the current project architecture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions