Is storing my application logs on disk a bad idea?

Asked

Viewed 31 times

2

We all know the importance of logs to the debug an application in a production environment.

Currently, I maintain the logs in an archive (/tmp/logs/app-logs.log). The problem is that it can get heavy over time, since the number of logs tends to grow along with the application.

I also think that saving in the application database (Mysql) may not be very advantageous, since the volume of logs can be large and the amount of darlings would be monstrous.

The question is, can I keep the logs of my application in a file and go emptying it over time or there is some way a little more suitable to do this?

1 answer

0

Buddy, you can make these logs "erased" from time to time. I often use log storage, because if some bug occurs and for some unknown reason the program closes without showing the error message, it is almost certain that you will find the reason for this bug in the logs. Tip: You can check the file creation/editing date, and compare it to the current date, if the difference of days/months between the dates is greater than 'n' (where 'n' is the interval to recycle this file), you delete all content from within it. Hugs!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.