maliary Posted October 16, 2007 Share Posted October 16, 2007 Hi, My apache access log is growing too big.Whats the best possible way of reducing its size ? Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/ Share on other sites More sharing options...
effigy Posted October 16, 2007 Share Posted October 16, 2007 What are you logging that is not important to you? For future logging, I recommend cronolog. Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-370738 Share on other sites More sharing options...
steviewdr Posted October 20, 2007 Share Posted October 20, 2007 Linux uses logrotate to rotate apache logs daily or weekly. It zips up the old ones. I dont know if there is a similar system for windows. -steve Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-374062 Share on other sites More sharing options...
Ninjakreborn Posted October 20, 2007 Share Posted October 20, 2007 Well you can just open your log file,and delete everything out of it. Like a clean page. Then it'll just start loggin from that point. Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-374197 Share on other sites More sharing options...
maliary Posted October 22, 2007 Author Share Posted October 22, 2007 Thanks businessman332211, Well you can just open your log file,and delete everything out of it. Like a clean page. Then it'll just start loggin from that point. I need something that works automatically after a certain period of time, say at the end of 30 days. Is this possible, in what language? Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-375466 Share on other sites More sharing options...
effigy Posted October 22, 2007 Share Posted October 22, 2007 To delete the log? You can create a shell script and run it through cron. Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-375499 Share on other sites More sharing options...
maliary Posted October 23, 2007 Author Share Posted October 23, 2007 Am pretty lame on c and c++, what other language can be used here ? Is there another way around this ? Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-376022 Share on other sites More sharing options...
effigy Posted October 23, 2007 Share Posted October 23, 2007 What OS are you on--Windows, Unix, or Mac? Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-376169 Share on other sites More sharing options...
maliary Posted October 24, 2007 Author Share Posted October 24, 2007 Windows Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-376891 Share on other sites More sharing options...
miksel Posted October 24, 2007 Share Posted October 24, 2007 Make a .bat-file that does: echo . > logfile and run the bat-file in windows scheduler You will get an empty logfile with just one "." (dot) in it. Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-377376 Share on other sites More sharing options...
maliary Posted October 25, 2007 Author Share Posted October 25, 2007 Thanks Miksel but will this delete the previous access log ? Or what happens ? Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-377614 Share on other sites More sharing options...
steviewdr Posted October 26, 2007 Share Posted October 26, 2007 You might have to stop apache before you (re)move the logfile. Your batch file should be something like: c:\path\to\apache2 stop copy access_log.txt access_log_$date.txt (see: http://www.windowsitpro.com/Article/ArticleID/13575/13575.html) delete access_log.txt c:\path\to\apache2 start -steve Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-378526 Share on other sites More sharing options...
maliary Posted October 30, 2007 Author Share Posted October 30, 2007 How does the windows scheduler work in this ? Quote Link to comment https://forums.phpfreaks.com/topic/73489-apache-question/#findComment-381124 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.