directus / v8-archive

Directus Database API — Wraps Custom SQL Databases with a REST/GraphQL API
https://docs.directus.io/api/reference.html
505 stars 204 forks source link

Split Log Files into Days – Options for Pruning After X Days #16

Closed rijkvanzanten closed 6 years ago

rijkvanzanten commented 6 years ago

Right now, there is no limit on the filesize of the logs. This can potentially result in huge huge file. We need to implement either a max filesize for the logs, or an "expiry date". (Either delete old records when filesize > threshold, or when logs.date < threshold)

wellingguzman commented 6 years ago

I can create the logs to be one-liner and separated by day, which can make each file smaller, but the API shouldn't be looking at those files sizes and take actions based on it.

This should be separate job outside the API workflow.

benhaynes commented 6 years ago

Why not create a new Log file for each day? Then we can set in the app how many days to store and prune (delete) the older ones based on the Settings.

Thoughts @WellingGuzman @rijkvanzanten ?

wellingguzman commented 6 years ago

The logger levels and names are flipped in the array.

wellingguzman commented 6 years ago

Closed by https://github.com/directus/api/commit/55ccd8b8c61b9067a698281ac2577706e2b063fd

benhaynes commented 6 years ago

@WellingGuzman – soooo... what do we have completed here? Log files per day and a directus_settings option for how many days to keep before deleting?

I don't know what "levels" and "flips" means.

rijkvanzanten commented 6 years ago

Doc doc doc doc doc documentation!

wellingguzman commented 6 years ago

There's no configuration yet as we need to implement a cronjob manager for Directus. (Created a ticket for this https://github.com/directus/api/issues/200)

I don't know what "levels" and "flips" means.

It was a bug creating the files name. creating 400.<date> instead of error.<date>

Doc doc doc doc doc documentation!

https://github.com/directus/api/wiki/Directus-CLI#log-module