dgrant / eyefiserver2

A standalone Eye-Fi server in Python, for Linux
GNU General Public License v3.0
140 stars 40 forks source link

Log file rotation should be taken care of by logrotate #4

Open dgrant opened 10 years ago

dgrant commented 10 years ago

See comment from here: https://code.google.com/p/eyefiserver/issues/detail?id=5#c1 which I agree with: "I'm not sure I want that here. IMHO log rotating should be done by the server maintainance scripts, like logrotate."

It was me who originally committed the log rotation but I agree, that using logrotate is better.

Need to add SigUSR1Handler so that we can handle the SIGUSR1 signal that logrotate uses (this is too avoid using copytruncate option of logrotate which can potentially lead to loss of somes lines of the log).

dgrant commented 10 years ago

Anyone who runs eyefiserver on a NAS: what do you prefer?

We could also do our own rotation, but we should allow it to be configurable in the eyefiserver conf file.

vsimonaitis commented 10 years ago

I guess the log should be cleared on server start ant log output should be minimized.

dgrant commented 10 years ago

You mean cleared on server start by the init script in the NAS scenario? I'm thinking in the non-NAS scenario, we just need to log to a fixed location and do no clearing of logs, and no rotation. logrotate should handle everything else, just as it does for all the other logs in /var/log typically.

vsimonaitis commented 10 years ago

OK, here is the solution: Log rotate should create separate file Every time the server is started. "Clear log" command should also create a new file instead of clearing it (without restastaring the server). On the NAS Web frontend most current log should be displayed.

BTW David, is the log output size is controlled by config? I mean, for the average user the soap messages should not be logged. All is needed to display transfered files:

  1. Uploading DSC_123456.jpg...
  2. Uploading DSC_123456.jpg... 3.5Mb Done
dgrant commented 10 years ago

I'm not sure if we are taking about the same thing here. I'm talking about making eyefiserver2 append log messages to a fixed location and do no rotation. logrotate (the unix command) or some other tool will rotate the logs.