Clean messaging logs of Tyke API Manager

Hi all,

Is there a feature to delete logs in Tyk after a certain timeframe? Currently we execute the following query in MongoDB to delete the logs which are created before a certain date:
db.tyk_analytics.deleteMany({ timestamp : {$lt:ISODate(“TIMESTAMP”)} })

I don’t know if this delete action has impact on Tyk besides the fact that you cannot consult the logging anymore in the log browser. Maybe you guys have tips for me how to delete logging the correct way?

Kind regards,


Hi Tim,

At present we don’t really have a means of clearing logs from within Tyk. We typically advise users to cap their collections to a particular size which would achieve a similar affect however, the removal of log data would have to take place within your MongoDB instance in order to work.

Kind regards,
Jess @ Tyk

Hi Jess,

Thanks for the tip. I will convert the tyk_analytics to a capped collection.

Kind regards,

Tim Lansbergen