This topic is about how to rotate the log , means how to generate a new log day by day with file size 5MB.
Making IBM HTTP Server Logs Rotates/Rolls Dialy
IBM HTTP Server has many Logs for it under Folder "<Installation_Directory>/IBM/HTTPServer/logs", sometimes those logs take much more time to open if they were too large and logged many data, you can customize those log files , we can say that defaults log in IBM HTTP Server are:
- Admin Log : admin_access.log
- Admin Error Log : admin_error.log.
- Access Log : access_log.
- Error Log : error_log.
In This tutorial we well represent how to make "Access log and Error Log" Rolling By Day and by Size :
Note : This tutorial in IBM HTTP Server v8.5 and Red hat Linux , take care when implementing it on other OS's
Steps in Appending the Logs it seems Like Apache Http Server :
- Locate IBM HTTP Server in <Installation_DIR>/IBMHTTPServer/conf in Your Operating System, to edit the configuration.
- Then Open httpd.conf.
- Locate the line : CustomLog log/access_log common.
- Comment the line, after this line type :
CommonLog "|/opt/IBM/HTTPServer/bin/rotatelog -l /opt/IBM/HTTPServer/log/access_log.%Y.%m.%d 5M" common
Where"y"represents Year, "m" for month, "d" for date and "5M" for 5MB files size.
- Locate the Line : ErrorLog log/error_log.
- Comement the Line and press enter and Enter the Code Below instead the current one :
ErrorLog "|/opt/IBM/HTTPServer/bin/rotatelog -l /opt/IBM/HTTPServer/log/error_log.%Y.%m.%d 5M"
- Then Restart IBM HTTP Server .
- Type the URL for the Host for IBM HTTP Server from Browser and you can see the access log is logging by the Current date.
For Every 5 minutes an new log will be generated and the old log will be saved as above
References :
rotatelogs - Piped logging program to rotate Apache logs is a simple program for use in conjunction with Apache's piped logfile feature. It supports rotation based on a time interval or maximum size of the log
No comments:
Post a Comment