It's all about the answers!

Ask a question

How can I rotate my access.log file using httpd.conf on IHS?


Stephane Couillaud (15631940) | asked Jul 17 '13, 7:32 p.m.
I'm trying to rotate my access.log file on my IHS server which has grown to 5GB+ lately. Problem is no matter what syntax I use in httpd.conf it just doesn't work. For testing purposes, I tried to rotate it every 60 seconds in the following three examples:

Example #1:

CustomLog "|\"C:/Program Files/IBM/HTTPServer/bin/rotatelogs.exe\" \"C:/Program Files/IBM/HTTPServer/logs/access.log\" 60" common

Example #2:

CustomLog "|\”C:/Program Files/IBM/HTTPServer/bin/rotatelogs.exe\” logs/access.log 60" common

Example #3:

CustomLog "|C:/Program\ Files/IBM/HTTPServer/bin/rotatelogs.exe logs/access.log 60" common

As far as I can tell the syntax appears correct as I can see that rotatelogs.exe script (two even) started in task manager.  There are no errors reported in the error.log file when I start the HTTP server.

I'm doing this in Windows 2008 R2 where I have WebSphere 7.0.0.23 installed.  

Has anyone experienced a similar issue?  Any recommendations?

4 answers



permanent link
Guido Schneider (3.4k1384112) | answered Oct 31 '13, 9:48 a.m.
I have following statement in my httpd.conf on my CLM server on
- Windows 2008-R2
- IHS 8.0.0.6

ErrorLog "|bin/rotatelogs.exe C:/logs/HTTPServer/error_%Y_%m_%d_%H_%M_%S.log 86400"
CustomLog "|bin/rotatelogs.exe C:/logs/HTTPServer/access_%Y_%m_%d_%H_%M_%S.log 86400" common




permanent link
Abraham Sweiss (2.4k1131) | answered Jul 18 '13, 7:22 p.m.
GIve this one a shot

CustomLog "|rotatelogs.exe -l \"C:/Program iles/IBM/HTTPServer615/logs/access_%Y-%m-%d-%H_%M_%S.log\" 60" common


Comments
Stephane Couillaud commented Jul 18 '13, 8:56 p.m.

 Hi Abraham,


I actually tried that option too today, per the recommendation of IBM, but I get the following error in the error.log file when I restart the HTTP server:

Starting the IBM HTTP Server 7.0 service
The IBM HTTP Server 7.0 service is running.
s.exe -l "C:/Program Files/IBM/HTTPServer/logs/access_%Y-%m-%d-%H_%M_%S.log" 60': The system cannot find the file specified.  
Unable to open logs

Prepending "bin/" before rotatelogs.exe does not help either.


permanent link
Abraham Sweiss (2.4k1131) | answered Jul 19 '13, 8:42 a.m.
try the following

customLog "|rotatelogs.exe -l /logs/access.log 60" common

when I saved this in the httpd.conf I ran the apache -t command and confirmed the syntax is correct.

Comments
Stephane Couillaud commented Jul 19 '13, 2:05 p.m.

I'm afraid I tried this as well.  The Syntax is OK.


permanent link
Abraham Sweiss (2.4k1131) | answered Jul 19 '13, 8:45 a.m.
One other suggestion.  SInce IHS is running as a service, use absolute paths.

Comments
Stephane Couillaud commented Jul 19 '13, 2:06 p.m.

 That was actually the first thing I tried.  It also didn't work.  I also checked the syntax to make sure I wasn't doing a mistake.  :(

Your answer


Register or to post your answer.