Odoo Help

0

[8.0] Logging sometimes stops on day change, w/ logrotate=True

By
Anton Chepurov
on 8/15/16, 4:27 AM 826 views

What could be the reason that logging sometimes stops on day change?

After I've noticed that sometimes logs don't rotate on day change and keep on logging to the same file for many days, I've introduced the following minor change to openerp/netsvc.py:

 if dirname and not os.path.isdir(dirname):
    os.makedirs(dirname)
if tools.config['logrotate'] is not False:
- handler = logging.handlers.TimedRotatingFileHandler(filename=logf, when='D', interval=1, backupCount=30)
+ handler = logging.handlers.TimedRotatingFileHandler(filename=logf, when='midnight', interval=1, backupCount=30)
elif os.name == 'posix':
    handler = logging.handlers.WatchedFileHandler(logf)
else:

This solved the issue of log files not rotating every day.

However, logger now sometimes stops and only resumes writing to log files after server restart.

Could it have smth to do with the fact that I start 2 servers on the same DB, both w/ workers>0: one is HTTP-only (workers=17, max_cron_threads=0), second is Cron-only (workers=8, max_cron_threads=8, --no-xmlrpc)? I do so because I need to have different settings for limit_memory_*, limit_time_* and logfile for WorkerHTTP and WorkerCron. The 2 servers use different logfiles, so AFAIK that should not be the cause of the problem described (logger stops at times).

0
Anton Chepurov
On 8/16/16, 9:58 AM

And here is the answer:

https://www.odoo.com/forum/help-1/question/is-logging-safe-when-using-multiple-workers-43562

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 8/15/16, 4:27 AM
Seen: 826 times
Last updated: 8/16/16, 9:58 AM