diff --git a/doc/reference/cmdline.rst b/doc/reference/cmdline.rst index 83df644f150..de96e733959 100644 --- a/doc/reference/cmdline.rst +++ b/doc/reference/cmdline.rst @@ -304,19 +304,6 @@ customize the amount of logging output `_ and will automatically be reopened when replaced -.. option:: --logrotate - - enables `log rotation `_ - daily, keeping 30 backups. Log rotation frequency and number of backups is - not configurable. - - .. danger:: - - Built-in log rotation is not reliable in multi-workers scenarios - and may incur significant data loss. It is *strongly recommended* to - use an external log rotation utility or use system loggers (--syslog) - instead. - .. option:: --syslog logs to the system's event logger: `syslog on unices `_ 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) diff --git a/odoo/tools/config.py b/odoo/tools/config.py index 812e4e2adc6..c499078dcd5 100644 --- a/odoo/tools/config.py +++ b/odoo/tools/config.py @@ -167,7 +167,6 @@ class configmanager(object): # Logging Group group = optparse.OptionGroup(parser, "Logging Configuration") group.add_option("--logfile", dest="logfile", help="file where the server log will be stored") - group.add_option("--logrotate", dest="logrotate", action="store_true", my_default=False, help="enable logfile rotation") group.add_option("--syslog", action="store_true", dest="syslog", my_default=False, help="Send the log to the syslog server") group.add_option('--log-handler', action="append", default=[], my_default=DEFAULT_LOG_HANDLER, metavar="PREFIX:LEVEL", help='setup a handler at LEVEL for a given PREFIX. An empty PREFIX indicates the root logger. This option can be repeated. Example: "odoo.orm:DEBUG" or "werkzeug:CRITICAL" (default: ":INFO")') group.add_option('--log-request', action="append_const", dest="log_handler", const="odoo.http.rpc.request:DEBUG", help='shortcut for --log-handler=odoo.http.rpc.request:DEBUG') @@ -429,7 +428,7 @@ class configmanager(object): keys = [ 'language', 'translate_out', 'translate_in', 'overwrite_existing_translations', 'dev_mode', 'shell_interface', 'smtp_ssl', 'load_language', - 'stop_after_init', 'logrotate', 'without_demo', 'http_enable', 'syslog', + 'stop_after_init', 'without_demo', 'http_enable', 'syslog', 'list_db', 'proxy_mode', 'test_file', 'test_tags', 'osv_memory_count_limit', 'osv_memory_age_limit', 'max_cron_threads', 'unaccent',