Need to shrink/delete apache logs

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Need to shrink/delete apache logs

Postby oniGLH » 08. December 2011 16:28

Hello,

the log files located in C:\xampp\apache\logs are very large (3.7GB) and I would like to shrink them/delete them if I can.

is this possible? If so,how do I go about doing this?

XAMPP version: 1.7.4
Windows version: Server 2008
oniGLH
 
Posts: 1
Joined: 08. December 2011 16:23
Operating System: server 2008

Re: Need to shrink/delete apache logs

Postby Altrea » 08. December 2011 18:34

Hi,

simply delete the file or copy it to another place abd zip it if you want to keep it.
The log file(s) will be created again if they are not in place.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Need to shrink/delete apache logs

Postby zardiw » 04. March 2012 05:18

That's all well and good......however is there some setting that will limit the size of this, or delete data that's say more than 5 days old?........z
zardiw
 
Posts: 19
Joined: 01. September 2011 20:06

Re: Need to shrink/delete apache logs

Postby hackattack142 » 04. March 2012 06:06

Short answer: No. Apache does not have such functionality built-in. You could, for example, create a batch file that that leverages rotatelogs.exe in the /xampp/apache/bin folder or that deletes the files in the logs folder and use the Windows Scheduler to run it every so many days.
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: Need to shrink/delete apache logs

Postby anselm » 06. March 2012 08:20

hi all,

i found this article.....

http://www.sitebuddy.com/mod_log_rotate

i've checked this on win xp sp3 xampp 1.7.1 (apache v.2.2.11)

download the mod_log_rotate.dll or mod_log_rotate.so for Apache XXX version 08_2006
move the mod_log_rotateXXX_08_2006.so to xampp/apache/modules/mod_log_rotate.so or mod_log_rotate.dll

edit http.conf
ErrorLog "| C:/xampp/apache/bin/rotatelogs.exe C:/xampp/apache/logs/error.%Y.%m.%d.log 86400"
(please note! which opens two boxes cmd......)

LoadModule log_rotate_module modules/mod_log_rotate.so

CustomLog "logs/access.%y.%m.%d.log" combined
RotateLogs On
RotateLogsLocalTime On
RotateInterval 84600 (in seconds)
anselm
 

Re: Need to shrink/delete apache logs

Postby hackattack142 » 06. March 2012 23:53

As a general note to others, the provided link will only work on XAMPP versions prior to 1.7.5 (compiled with VC6).
XAMPP Control Panel Developer
Latest CP: viewtopic.php?f=16&t=48932
hackattack142
 
Posts: 701
Joined: 20. May 2011 23:29
Operating System: Windows 7 Ultimate SP1 64-Bit

Re: Need to shrink/delete apache logs

Postby Altrea » 08. March 2012 00:43

There is a VC9 log_rotate module available for Apache 2.2 here @ Apachelounge
That should work for XAMPP 1.7.5+ (not tested yet)

best wises,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 124 guests