Nextcloud 19.0.3 creates test.log files

Nextcloud version (eg, 18.0.2): 19.0.3
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.1): 7.3

The issue you are facing:

I just wanted to upgrade from 19.0.3 to 19.0.4 and I got an error “The following extra files have been found: test.log” … ok. I erased them and tried again but they are re-created so fast that I cannot update … I have a second installation on the same server without this problem (the main diff between the 2 install is that this one has been installed with nc19 while the other one is older and has been updated to nc19).
Files are always created as follow:

  • one in root folder,
  • one in /core/ajax
  • one in /ocs
    I was stupid to erase them because I seem to recall that they were not empty (they had a size) while the new ones are 0k so far …

Is this the first time you’ve seen this error? (Y/N): No it happened a while back and erasing the files (that were signaled by the integrity check) solved the problem.

Pierre

Hello,

I’m answering to myself, having found the reason. In my config.php I had, in addition to loglevel=>3

“log_type” => “file”,
“logfile” => “test.log”,

The weird part is that I cannot recall ever adding this myself in that config wich is quite recent (as I said it has been installed as nc19). I did put back to 2 the loglevel.

Sorry for the noise !
Pierre

Hello,

I’m answering myself again, because I have the feeling that this could qualify as a bug: if I have officially asked in my config.php to have a log_type as “file” and told that the log_file would be called “test.log”, how comes that the integrity check says these files are “unwanted” ? shouldn’t the integrity check take these info from config.php and validate the files that are subsequently created ?

Pierre

The message doesn’t say that the “test.log” file is “unwanted”, but that extra files have been found in the Nextcloud document root directory which are not allowed to be stored there. So everything would have been fine, if you had stored it outside that directory.

Well it does not seem that I am to decide where to put these files (unless I would be able to specify a path in the “logfile” variable) ! plus the fact that it does create automatically these 3 files in 3 different places (with that same name specified in the “logfile” variable), how would I specify where these files would go ?

As usual this question can be answered by simply reading the administrator guide. :wink:
By default a log file named “nextcloud.log” is created in the Nextcloud data directory. As soon as you decide to customize the value of this parameter it’s your choice where to store it. So prefixing the log file name with an absolute path is highly recommended.

1 Like

Well, yes when you read the page you mentioned it seems pretty clear. However I did read documentation but the page I read is not as clear …

Yours: https://docs.nextcloud.com/server/20/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=logfile#logging

Mine: https://docs.nextcloud.com/server/20/admin_manual/configuration_server/logging_configuration.html

Didn’t see there was another place, I assumed I had all that was available, apparently I was wrong. There is mention of the default datadirectory for nextcloud.log but no exemple demonstrating the possibility of adding a path. Plus the fact that, as I said, the file is created 3 times in 3 different places leading one to think that mentionning a path is irrelevant unless I could add 3 path’s …

And nevertheless, I still think that the integrity check should take that file into account when it is properly declared in config.php, wherever the file is placed. “Highly recommended path” is your opinion, because when I read either doc I don’t see the path as being mandatory or highly recommended, there should maybe be a warning that without path the file will be placed in the root directory. English not being my main language, my first impression with your doc was that the file would be placed by default in the datadirectory (like nextcloud.log) with my name, only the exemple let me understand the possibility of a different path.