PeerTube logs directory fills up fast

Hello - and thanks for making such a great piece of software. I’ve been experimenting with it for a few months and was so impressed I immediately setup a monthly donation to Framasoft!

Our instance is running on Yunohost and this week we opened up to more visitors thru a campaign related to Mozilla Festival. The site soon collapsed with 502 Bad Gateway errors. Deleting files and backups on the server made it clear this happened when the server ran out of space. But once I cleared space it didin’t take long for the site to break again. I wasn’t sure why - I could just use the Yunohost diagnosis to see the available HD space shrink.

Eventually I found the cause… the /logs directory had grown to 12GB on a 40GB server. With a reboot and doubling of RAM, it’s back at 6GB - but I’m wondering how if I can clear this directory automatically, to reduce the number of logs saves - or if I just need to ssh in and ‹ sudo rm -rf * › regularly? Also why does it fill so fast - is it a sign of something else wrong? Many thanks.


PeerTube should automatically rotate log files (PeerTube/production.yaml.example at develop · Chocobozzz/PeerTube · GitHub)

What are the logs content?

Hi, thanks. The biggest files (215mb) are peertube1.log.1, peertube2.log.1, etc - that runs until peertube18.log.1. Then there’s peertube1.log to peertube40.log - each around 40mb. There’s also zips of some of these files.

I’m assuming it’s safe to delete them all?

Check the Peertube log level. On a production server, it should be «info» or «warn», and especially not «debug».
I don’t know what’s the default value on a yunohost installations ; neither how to change it. On a standard installation it is done by modifing the /var/www/peertube/config/production.yml file, and restarting the peertube service.

If it is already «info», try «warn» or «error».

Thanks. That file is blank unfortunately. I can see default.yml, etc in that directory tho. I’ve asked in the Yunohost forum about the location for wherever that’s set.

I think there is a conflict in your log management: PeerTube can’t correctly rotates files because there is another tool (logrotate) that already does this job.

Thanks very much - I’ve asked them about this.