Logs

Every so often I remember that many of the softwares I am running are constantly spewing log entries. Usually this is when I am desperately trying to figure out what is broken someplace and the logs will give me a clue as to what, where, when, why.

But sometimes it is because of the logs themselves.

Not so long ago the Nextcloud instance was upgraded to version 12. And then I started very slowly migrating the contents of the photo gallery to the cloud. And suddenly the Nextcloud log was ballooning in size. And here is why:

public function fileCreate($path) {
	if ($path === '/') {
 		return;
 	}
 	...

The activity-logging module examined if the path node to create was the last in the string, and if so end. Except there were several other possible ‘end of path’ results, like an empty string, or a null string. And the activity logger can be called from anywhere, so any perfectly valid string might end up hitting this line and, if not captured here, go on to throw an error.

In my logs, every video or photo file migrated was throwing this error at least once, and sometimes several times. And again every time the file was touched as I looked into Exif, IPTC, or XMP (about which, by the way, I should write a rant.) And the script I am dabbling in to automate some tasks (structure testing, compression optimizing, etc.) will likely touch each file several times, with the possibility of tens of thousands of error events being logged.

Anyway, the point is I tried to check something in the error log and could not find easily find the needle in a hasystack of hundreds of path errors. And obviously the log is getting biggish. So I went looking to see if I needed to file a bug and discovered this has been a known issue since the 12.0beta stages, but a really low impact (none, really) so they set it aside until later. And later happened 15 days ago, with a pull request accepted to master:

public function fileCreate($path) {
	if ($path === '/' || $path === '' || $path === null) {
 		return;
 	}
 	...

Such a little thing! I manually updated my local installation because I cannot find a roadmap suggesting when the master will be released as an incremental.