didcot84 — 2012-05-10T11:44:12-04:00 — #1
Good Afternoon All
Our php-errors.log file is creating an extremely large file on a new windows 2008 server running IIS7.
We are going to go through and correct all of the errors, but in the meantime, is there a way that I can restrict the file size?
I've looked at http://php.net/manual/en/errorfunc.configuration.php but this didn't seem to offer an answer.
Thank you in advance for any help
cpradio — 2012-05-10T11:50:15-04:00 — #2
didcot84 — 2012-05-10T12:18:44-04:00 — #3
Thankyou for replying so quickly cpradio
Something seems to be not quite right here.
My php.ini file configuration is the default
log_errors_max_len = 1024
But the log_errors file size is well over 1024 bytes?
Thats why I didn't think that this was the solution. Would there be another configuration overiding this?
cpradio — 2012-05-10T12:42:47-04:00 — #4
Well, it seems you and I both get to learn something new today. From StackOverflow, that setting only affects the max length for a single log entry, not the size of the error log. Why you would need 1 KB (the default) for a single log entry is beyond me.
Looks like you can use this log rotation tool in combination with 7-zip's command line utility to control your logs (granted you will need to edit it to point to the PHP logs instead of apache.
didcot84 — 2012-05-10T13:34:32-04:00 — #5
Thank you very much again cpradio
I will look into this and let you know the result
Thanks again, have a good evening
didcot84 — 2012-05-10T13:48:08-04:00 — #6
I'm just leaving the office, but can I just confirm this script will work with a windows server?
cpradio — 2012-05-10T13:59:23-04:00 — #7
From what I understand the script I linked to was designed for a windows server
john_betong — 2012-05-11T00:33:27-04:00 — #8
Play about with these file name settings:
ini_set('error_log', APPPATH .'php_error_' .date('Y-m-d-h-m') .'.log');
didcot84 — 2012-05-11T05:55:11-04:00 — #9
I'll play around with both of these ideas, thanks for all of your help, I appreciate you both taking the time and responding so quickly.