Rotation of logs are not working in Sync Gateway 2.7.1

Hi,

I have just updated the sync gateway version from 2.1 to 2.7. But rotations of logging is not working which cause the sync gateway down in case of huge size logs. Please find below the logging configurations which I am using in sync gateway configuration file -

“logging”: {
“log_file_path” : “/home/sync_gateway/logs”,
“console”: {
“log_level”: “info”,
“log_keys”: ["*"],
“color_enabled”: true
},
“error”: {
“enabled”: true,
“rotation”: {
“max_size”: 10,
“max_age”: 180,
“localtime”: false
}
},
“warn”: {
“enabled”: true,
“rotation”: {
“max_size”: 10,
“max_age”: 90,
“localtime”: false
}
},
“info”: {
“enabled”: true,
“rotation”: {
“max_size”: 10,
“max_age”: 5,
“localtime”: false
}
},
“debug”: {
“enabled”: false,
“rotation”: {
“max_size”: 10,
“max_age”: 7,
“localtime”: false
}
}
},

Do anyone have idea why its not working. Also i want to disable the ‘sg_stats.log’ logging, which is by default coming. How can i do the same also? Thanks in advance.

Stats logging can be disabled with this config option:

{
  "unsupported": {
    "stats_log_freq_secs": 0
  }
}

Your logging config looks OK. I just used it to create some rotated log files, I’m not able to reproduce the issue.

Can you share more detail about what platform you’re using?
And can you check the directory permissions are OK on /home/sync_gateway/logs?

Thanks [bbrks].

Will try the given conf for ‘stats’ logging. I am using the below platform -

CentOS 7
CouchBase Enterprise Version 5.0.0

Directory permission are OK at the moment.

Will also check rotation of logs after changing stats conf, it might be the reason that because of ‘stats’ log huge size its creating the problem.

Thanks bbrks.

‘stats’ log has been disabled now. I am getting another issue like the changes list URL is going down after some time when restart sync gateway then it works, haven’t face this kind of issue with sync gateway 2.1 version. Do you have any idea what could be the reason for the same?

http://domainName:4985/db/_changes

Its working now. Thanks bbrks. We also have to disable the ‘console’ log as like which was causing the issue to ‘_changes’ URL

“console”: {
“enabled”: false,
“log_level”: “info”,
“log_keys”: ["*"],
“color_enabled”: true
}