The audit log captures a record of every significant action performed in Inventario SUD. Each entry stores what was done, who did it, when it happened, and the IP address the request came from. This gives your leadership team a complete, tamper-proof accountability trail for all inventory activity without relying on memory or manual notes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ChrisCore1/inventario_sud/llms.txt
Use this file to discover all available pages before exploring further.
Accessing the audit log
Navigate to Auditoría in the sidebar. The page loads all log entries ordered by most recent first, with each row showing the action description, the user’s name and role, the timestamp, and the IP address.Log schema
The audit log is stored in theAuditoria_log table. The Drizzle schema is defined in lib/schema.ts.
| Field | Type | Description |
|---|---|---|
id_log | serial | Auto-incrementing primary key. |
accion_realizada | varchar | Human-readable description of the action that was performed. |
fecha_hora | timestamp | Server timestamp set automatically when the record is inserted. |
direccion_ip | varchar | IP address of the client that made the request. Up to 45 characters to support IPv6. |
id_usuario | integer | Foreign key referencing the Usuario who performed the action. |
What gets logged
The following actions are written to the audit log automatically:- Asset management — registering a new asset, editing asset details, soft-deleting an asset
- Consumable management — registering a new consumable, editing quantity or details, soft-deleting a consumable
- Loan management — creating a new loan, editing loan details, cancelling (soft-deleting) a loan
- User management — creating a new user account, deleting a user account
- Biometric calibration — registering or updating a user’s facial biometric vector
Append-only design
The audit log is append-only. No user, including an Obispo, can edit or delete log entries through the application UI. TheAuditoria_log table has no soft-delete flag and no update action is exposed through any server action or API route. Entries remain permanent unless removed directly at the database level by a database administrator.
The IP address stored in each log entry is read from the
x-forwarded-for request header first, then falls back to x-real-ip. If your deployment sits behind a reverse proxy or load balancer, ensure the proxy forwards the real client IP in one of these headers so the logged address reflects the actual user rather than the proxy.