Introduction
Tyk Dashboard’s audit log system captures detailed records of all requests made to endpoints under the/api route, providing a record of user activity via Dashboard API or in the UI. The audit logs can be written to local files or to the Control Plane’s persistent storage database, providing flexible options for log management and retrieval.
See Enable and View Audit Logs in Tyk Dashboard for a step-by-step guide on using the audit log feature.
Enabling the Audit Log
The audit log is configured within the Tyk Dashboard config file (tyk_analytics.conf) or using the equivalent environment variables.
Please consult Tyk Dashboard Configuration Options for equivalent configuration with environment variables.
The legacy setting
security.audit_log_path can also be used to enable audit logging. This accepts a file path and combines the functionality of audit.enabled and audit.path. The value configured in audit.path will overrule anything set in security.audit_log_path.Audit Log Storage
Ifaudit.store_type is set to file, the logs will be added to the file identified using audit.path, in JSON or text format depending on the configuration of audit.format. In text format, each field is written on its own line, in the order listed in the table below.
If hosting Tyk Dashboard within a Kubernetes cluster, please ensure that the configured log file path is valid and writeable.
audit.store_type is set to db, the logs will be added to a collection or table named audit_records in the Control Plane’s persistent storage, and audit.format is ignored: records are always stored in their native structured form, not as json or text. Database storage has been available since Tyk Dashboard v5.7.0.
Tyk does not manage the size of the audit log file or collection.
Audit Log Content
For each request made to the Tyk Dashboard API’s/api/* endpoints, a log will be generated containing the following data: