I just released my web application.
However I’m curious about production.log’s size.
It will be increased forever and will need so much disk space only for that.
How can I take care of this?
What people usually do to maintain?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would expect your logging framework to roll and date logs e.g. you would get logs like:
etc..
Furthermore I would expect admins (or someone else) to set up a cron job or similar to remove or zip up (or both) old logs. Other than for long term traffic/data analysis, the logs you’re interested in are most likely todays, followed by yesterdays and perhaps last weeks. The older they are, the less interesting they may be.
Check out logrotate which automates a lot of this.
You may also want to take the opportunity to remove or tidy logs when you release new versions of your application if, say, the new version creates log info radically different from the old versions, resulting in more difficult or perhaps irrelevant analysis.
Finally I would run some disk space monitoring in order to alert if disk space is running low. Regardless of the above, you may find that your application logs excessively in error conditions, or perhaps a new version logs more than expected. The last thing you want is for your application to grind to a halt if your log files fill up the disk (for this reason logs are often sent to a different disk partition –
/varperhaps – so if that fills up it won’t affect other processes)