haiwen/seafile — pull request #558 by drobin (2014-03-07 10:47:24+00:00)
Title: Enable log rotation

Hey guys!

On client-side there is a serious problem, where the logfiles grows unlimited. We were able to create a seafile.log with a size of >1GB...

I've a patch which implements log rotation for seafile. The max. file size and number of logfiles are specified with the MAX_LOG_SIZE resp. MAX_LOG_NUM macros. Log roration can be enabled with the SEAFILE_LOG_ROTATE option (new seafile_log_set_option function).

Log rotation is only required for the client. The server-platform usually has a logrotate-daemon. That's why I decided to define a "-R" commandline argument for seaf-daemon to enable logfile rotation. Later, the seafile-client has to start the daemon with the "-R" switch.

Could you please review the patch and give me a feedback?

Further steps: Logfile rotation for ccnet (ccnet.log) and seafile-client (applet.log). And (of course) the daemons should be started with the "-R" argument. I can provide the patches as well, but first I want to make sure, you accept the current solution.

Cheers, Robin.