I’m on Ubuntu 14.04
I tried to follow this documentation about log rotation
My current workflow is to start/stop/restart SG like these commands:
service sync_gateway start|stop|restart
I’d still like to use this workflow after setting up log rotation.
At the moment it seems that there is no log rotation setup as there is only one sync_gateway_error.log file which is GBs in size. I don’t know where to add this config:
/home/sync_gateway/logs/* { daily rotate 1 size 10M delaycompress compress notifempty missingok postrotate /usr/bin/pkill -HUP sync_gateway > /dev/null endscript }
Would I add this to the sync_gateway.json file? Mine look similar to this:
{ "interface": ":4984", "adminInterface": ":4985", "log": [ "CRUD", "CRUD+", "HTTP", "HTTP+", "Access", "Cache", "Changes", "Changes+" ], "databases": { "database-name": { "server": "http://localhost:8091", "bucket": "bucket-name", "allowEmptyPassword" : true, "users": { "GUEST": { "disabled": true, "admin_channels": [ "*" ] } }, "sync":
function(doc, oldDoc){
if(oldDoc){requireAccess(oldDoc.channels);}
channel (doc.channels) }} } }
So my two questions are:
- Where do I need to put the config?
- What needs to change so that I can use my current workflow?