Date: Tue, 19 Mar 2024 10:33:22 +0000 (UTC) Message-ID: <537559465.473.1710844402747@library.aws.roguewave.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_472_14643765.1710844402745" ------=_Part_472_14643765.1710844402745 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
It is a good idea to occasionally save the php.log file and start a new = one, to help prevent the log from growing too large. Linux users can = use the logrotate utility to do this, but there is no logrotate utility on = the IBM i. This article describes a simple method to periodically ren= ame the php.log file and let a new one be created.
Environment
Zend Server for IBM i on any supported version of IBM i running Zend Ser= ver 2020 or higher.
One simple way to rotate the php.l= og file is with a CL program set up to run in the IBM Job Scheduler. The so= urce for the CL program could look like this:
PGM DCL VAR(&TIMESTAMP) TYPE(*CHAR) LEN(20) DCL VAR(&NEWNAME) TYPE(*CHAR) LEN(30) RTVSYSVAL SYSVAL(QDATETIME) RTNVAR(&TIMESTAMP) CHGVAR VAR(&NEWNAME) VALUE('php.log.' *CAT &TIMESTAMP) RNM OBJ('/usr/local/zendphp74/var/log/php.log') + NEWOBJ(&NEWNAME) ENDPGM
This will append a timestamp to the end of the php.log file name. The ne= xt time PHP needs to write a php.log entry, it will create a new php.log fi= le. You can run this CL program periodically using the Job Scheduler.= Once a week might be a good choice.
Delete old renamed files periodically.=
Note: For Zend Server 9-2019 customers=
The location of the php.log file i= s /usr/local/zendphp7/var/log/php.log. Please adjust the above CL sou= rce accordingly.
Note: For Zend Server 6 - 8.x customer= s
The location of the php.log file i= s /usr/local/zendsvr6/var/log/php.log. Please adjust the above CL sou= rce accordingly.
Note: For Zend Server 5 customers
<= span class=3D"aui-icon aui-icon-small aui-iconfont-warning confluence-infor= mation-macro-icon">The location of the php.log file i= s /usr/local/zendsvr/var/log/php.log. Please adjust the above CL sour= ce accordingly.
To learn how to adjust the error_level setting so that the php.log file = grows more slowly, please take a look at this article:
Set error_reporting to control error reporting levels in the php.log file=