1

We have the following in our httpd.conf files:-

ErrorLog "| /usr/HTTPServer/bin/rotatelogs /wslogs/instance_name/hostname_%m%d%Y_error.log 86400"

CustomLog "| /usr/HTTPServer/bin/rotatelogs /wslogs/instance_name/hostname_%m%d%Y_access.log 86400" combined

This writes the piped logs to /wslogs/instance_name using the format described above.

We see that in no time these log files tend to occupy whole lot space under /wslogs and we are unaware of that. And then when we do our deployments that also has a step to restart server, the server fails to restart with an error:- httpd (no pid file) not running Error writing to the file /wslogs/instance_name/server_name_12022016_error.log

Then we have to manually clean the wslogs folder. Is there a way to automatically handle this and make sure these logs are there only for last 10 days, or in other words a way to delete logs older than 10 days.

Any suggestions/solutions here would be greatly appreciated.

Ashley
  • 1,447
  • 3
  • 26
  • 52
  • and your startup error is likely because you're deleting the instance_name directory instead of just its contents. – covener Dec 04 '16 at 00:07

1 Answers1

1

You cannot manage the historical files with the http server itself. You need to use something external like logrotate or your own cron scripts.

covener
  • 17,402
  • 2
  • 31
  • 45