diff options
| author | Xavier Morel <xmo@odoo.com> | 2018-05-14 13:57:27 +0000 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2018-11-27 14:05:03 +0000 |
| commit | 92d5a4bce5a3878e10427ec8dfef8c4b21f64f3d (patch) | |
| tree | 0b8550445223ad5d814c9fe878b7fb9991e72cca /odoo/netsvc.py | |
| parent | cb7589aaa5902c56ae5cbb9cee7b81b6b21bacb7 (diff) | |
[REM] builtin logrotate features
It's completely FUBAR when using workers[0] and properly
reimplementing it is not really worth the effort when logrotate(8) and
newsyslog(8) exist (or cyclog/multilog/cronolog if you subscribe to
the "logrotate and newsyslog are a design that should be consigned to
history" school of thought).
[0] https://stackoverflow.com/questions/34186774/why-doesnt-timedrotatingfilehandler-work-properly-and-how-to-solve-this-issuer
closes odoo/odoo#29073
Diffstat (limited to 'odoo/netsvc.py')
| -rw-r--r-- | odoo/netsvc.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/odoo/netsvc.py b/odoo/netsvc.py index 286ee740584..76bef839eec 100644 --- a/odoo/netsvc.py +++ b/odoo/netsvc.py @@ -156,16 +156,7 @@ def init_logger(): dirname = os.path.dirname(logf) if dirname and not os.path.isdir(dirname): os.makedirs(dirname) - if tools.config['logrotate'] is not False: - if tools.config['workers'] and tools.config['workers'] > 1: - # TODO: fallback to regular file logging in master for safe(r) defaults? - # - # Doing so here would be a good idea but also might break - # situations were people do log-shipping of rotated data? - _logger.warn("WARNING: built-in log rotation is not reliable in multi-worker scenarios and may incur significant data loss. " - "It is strongly recommended to use an external log rotation utility or use system loggers (--syslog) instead.") - handler = logging.handlers.TimedRotatingFileHandler(filename=logf, when='D', interval=1, backupCount=30) - elif os.name == 'posix': + if os.name == 'posix': handler = logging.handlers.WatchedFileHandler(logf) else: handler = logging.FileHandler(logf) |
