Clear logfile NOT logrotate [SOLVED]

any step by step hint howto clear the logfile

echo “” > /var/www/nextcloud.log

is not working the logs are still visible in under WEBIF (log)
grafik

brNP

Hi,

auto log rotation or even a button to clear the log from within the webgui would be nice. Until this feature doesn’t exist, I help myself with the following shell command (in ubuntu):

sudo -u www-data truncate /folder/where/logfile/is/stored/nextcloud.log --size 0

Hope this helps.

Greetings

2 Likes

clearing the log was the easy part :wink: echo does the trick too :wink:

but even with truncate and an empty log on cli
the logs are still on the gui

grafik

any ideas how to get rid of them ?

Could you check in the config.php the correct log file location and verify that you deleted exactly the same log file. Maybe you have two of them and just truncated the wrong one?

HOLY SMOKE !!!
/var/log/nextcloud.log …

and yes i turncated the wrong one !

thanks for the hint … to many other things gone wrong after updating to 19.01
sloved !

1 Like

I’m glad it worked

1 Like

24.12.23 NC Version 28.0.1

Is there finally a possibility to clear log from inside NC?

No as far as I know

THX for taking care.
I’m new with all this server stuff.
Pls help to find the right folder, I cannot find this path posted above
image
Many THX

1 Like

Should be in /var/www/nextcloud/data/nextcloud.log

1 Like

Thank you, not exactly, but the direction helped.

/var/www/nextcloud-data/nextcloud.log

In general:
nextcloud.log - is located in the root of the Nextcloud data directory.

1 Like

Thanks @alext92 and @tomcatcw1980.

I had some failed login attempts warnings and managed to clear with:

sudo -u www-data truncate /var/www/nextcloudfolderinstalation/data/nextcloud.log --size 0