Activity log for bug #1938347

Date Who What changed Old value New value Message
2021-07-28 22:24:31 Robert Lyon bug added bug
2021-07-28 22:25:49 Robert Lyon description There is a configuration option in Mahara where you can specify a file to save logging to. This is useful if you are wanting to debug something but do not have access to the apache/nginx error logs. The problem with it though is on every write to the file it deletes the existing data. What would be more useful is if the log file remembered existing lines of logging for better diagnosis. We would need to do it in such a way that we didn't end up with one giant log file that keeps growing until the server is full. My idea is this: If you have $cfg->log_file = $cfg->dataroot . '/logs/custom.log'; On writing to the file check the number of lines existing in the custom.log file and once it gets to be more that a certain number, say 10000 lines, it copies that file to custom.log.old and starts a new custom.log file to write to That way you only end up with max 2 files of max approx 20000 lines and it will be faster than trying to append new lines to base of custom.log while removing lines from start of custom.log There is a configuration option in Mahara where you can specify a file to save logging to. This is useful if you are wanting to debug something but do not have access to the apache/nginx error logs. The problem with it though is on every write to the file it deletes the existing data because we open the file with: $LOGFILE_FH = fopen($logfilename, 'wb'); What would be more useful is if the log file remembered existing lines of logging for better diagnosis, eg appending new lines to end of file. We would need to do it in such a way that we didn't end up with one giant log file that keeps growing until the server is full. My idea is this: If you have $cfg->log_file = $cfg->dataroot . '/logs/custom.log'; On writing to the file check the number of lines existing in the custom.log file and once it gets to be more that a certain number, say 10000 lines, it copies that file to custom.log.old and starts a new custom.log file to write to That way you only end up with max 2 files of max approx 20000 lines and it will be faster than trying to append new lines to base of custom.log while removing lines from start of custom.log
2021-07-28 22:25:54 Robert Lyon mahara: importance Undecided Wishlist
2021-08-01 19:50:54 Kristina Hoeppner mahara: status New Confirmed