cozy / cozy-emails

Email Client for Cozy
GNU Affero General Public License v3.0
66 stars 41 forks source link

email.log filling up disk, no logrotate mechanism #925

Open arthurlutz opened 8 years ago

arthurlutz commented 8 years ago

I'm not entirely sure where to file this bug, so feel free to redirect it to the appropriate project.

I have a cozy instance which I don't use very often and don't monitor. It ended up filling the disk of the machine on which it was running. The culprit was the emails.log which ended up being 30G.

# ls -alh  /var/lib/docker/aufs/diff/059f5cab7f317043257afdf8cc0a4a692435765bdf23d6acabe325f6165d593e/usr/local/var/log/cozy/emails.log
-rw-r--r-- 1 root root 29G sept.  9 10:38 /var/lib/docker/aufs/diff/059f5cab7f317043257afdf8cc0a4a692435765bdf23d6acabe325f6165d593e/usr/local/var/log/cozy/emails.log

Should cozy do some kind of log rotation ? Is it the task of cozy-emails ? Should this be a system side logrotate configuration ?

As you can see it's running inside Docker (but built a long time ago, so maybe this is now handled in https://github.com/cozy-labs/cozy-docker ?)

Thanks for your help and advice.

clochix commented 8 years ago

Hello @arthurlutz,

There's currently no log rotation, that's probably something that should be added system wide.

For the record, email's logs grow fast because the application was very verbose, to help us debug imap issues. We made it way less verbose some months ago. Also, logs are rotated each time the application restart. So, restarting the application from time to time is a workaround to prevent the logs from becoming to big.