Commit Graph
31 Commits
Author SHA1 Message Date
Xavier Morel fab1183907 [IMP] enable deprecation warnings 2020-02-04 12:42:35 +00:00
Xavier Morel b66a7feb0f [IMP] core: strip log_handler items before splitting them
Allows better formatted and commented log_handler items in
configuration files: configparser allows multiline values and
interspersed comments (stripping out comment lines), but while it
removes indent it leaves the linebreaks, so e.g.

    foo =
      bar,
      # qux
      quux

when parsed and split on "," results in `['\nbar', '\nquux']` which is
obviously an issue for logging (as it assumes the leading `\n` is part
of the logger name proper).

Since log_handler items can be fairly long and are not necessarily
self-descriptive as to *why* they were selected for re-configuration,
allowing one per line & comments is helpful.
2020-01-21 06:56:15 +00:00
Xavier Morel 56e47c51ed [REV] core: logger configuration part of 6044782aef
Configuring the non-root logger based on --log-level had the
side-effect (unclear whether it was intended or not as none of the
relevant commits really documented the idea) that log-level could
override log handlers being set on the root logger e.g. if
`log_handler = :INFO` is set in the config file, `--log-level=warn` on
the CLI will override it.

This could be replicated by swapping `pseudo_config` and `logconfig`,
*however* it would also make the sub-loggers override
differently (currently on an exact logger match log-handler overrides
log-level).

The ideal fix would likely be to sequence log-level from the
configuration file, log-handler from the configuration file, log-level
from the CLI and log-handler from the CLI. However that doesn't really
work with the current structure.

closes odoo/odoo#41180

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-12-02 12:38:49 +00:00
Xavier Morel 6044782aef [IMP] base: logging conf & logging of partner merge wizard
* root the base.partner.merge wizard's logger in odoo.addons so the
  "odoo" logger configuration properly applies to it
* update the default logging configuration to set the root logger
  rather than independently set the odoo and werkzeug loggers

closes odoo/odoo#40872

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-26 12:48:05 +00:00
Christophe Simonis be780012bf [MERGE] forward port branch 12.0 up to 0e72b983c3 2019-06-21 11:06:04 +02:00
Christophe Simonis 0e72b983c3 [MERGE] forward port branch saas-11.3 up to 35aeabb647 2019-06-21 10:17:10 +02:00
Christophe Simonis cc3f45ae0b [MERGE] forward port branch saas-15 up to e7fb3e2f1a 2019-06-20 12:06:59 +02:00
Christophe Simonis a7ad19d7fd [MERGE] forward port branch 10.0 up to c5c955db7a 2019-06-20 12:04:52 +02:00
Xavier Morel c5c955db7a [FIX] core: work around ir_logging deadlock
DROP CONSTRAINT (even with IF EXISTS is specified) acquires an ACCESS
EXCLUSIVE lock on the table, preventing e.g. inserts in an other
transaction, so ir_logging would systematically deadlock if configured
to the same database and a warning would be triggered during install
or update (if that ran ir.logging's init).

1. hand-roll the "IF EXISTS" bit, to avoid taking an ACCESS EXCLUSIVE
lock on the table if the problematic constraint does not exist and
thus doesn't need to be dropped (which by now should be the vast
majority of cases).

Replacing DROP CONSTRAINT with DISABLE TRIGGER does not fix the
issue as *that* acquires SHARE ROW EXCLUSIVE. While that's less
constraitning than ACCESS EXCLUSIVE, it still conflicts with an
insert's ROW_EXCLUSIVE.

2. add a timeout to the logging INSERT anyway, the deadlock is still
an issue if we're updating a database which does have the
problematic constraint, and we want to preclude the possible
eventual introduction of new deadlocks in the future.

closes odoo/odoo#34243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-19 13:43:53 +00:00
Xavier Morel 92d5a4bce5 [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
2018-11-27 14:05:03 +00:00
Christophe Monniez e9e864802f [REV] base: revert rename ir.logging type to logging_type
This reverts commit c42a130a98
and commit fb7ac56d65.

The runbot is using cross db logging and those commit were breaking the
mechanism. As a result, the master builds logs were empty.
If we update the runbot to use logging_type instead, the other versions
builds will be impacted hence this revert.

closes odoo/odoo#28512
2018-11-08 14:31:57 +00:00
mreficent c42a130a98 [FIX] base: logging_type remain
In fb7ac56 type field was renamed to logging_type
A few were missing

closes odoo/odoo#28447
2018-11-07 09:51:22 +00:00
Christophe Simonis 68d36512ef [MERGE] forward port branch saas-11.4 up to d78f23df84 2018-09-07 20:20:45 +02:00
Raphael Collet c33a013943 [FIX] server: fix colored query count 2018-09-07 15:07:20 +02:00
XavierDoandChristophe Monniez c44fe91232 [IMP] http,server: add query count and request times in logs
When there is a performance issue, it's sometimes difficult to discover
which request increased the query count or its duration.

With this commit, the query count, the query time and "python and io" time are displayed
in the logs at the end of each werkzeug request line.

Co-authored-by: Christophe Monniez <moc@odoo.com>
2018-09-07 10:27:46 +02:00
Magnus 4877030d64 [FIX] fatal error when trying to enable logrotate
4e5119c6e5 didn't account for
`tools.config['workers']` being `None` on windows, resulting in the
entire thing crashing when trying to execute `None > 1` in Python 3.

Fixes #26447
2018-08-30 16:20:10 +02:00
Christophe Simonis f2e105eeca [MERGE] forward port branch saas-15 up to d3a040cebe 2018-05-08 18:12:03 +02:00
Christophe Simonis 1f74b878f4 [MERGE] forward port branch 10.0 up to 0aeb92ccbc 2018-05-07 11:54:15 +02:00
Christophe Simonis 0aeb92ccbc [MERGE] forward port branch 9.0 up to 4e5119c6e5 2018-05-07 11:47:44 +02:00
Christophe Simonis 4d5ff6401c [MERGE] forward port branch saas-16 up to b76109173a 2017-07-28 18:37:10 +02:00
Christophe Simonis b76109173a [MERGE] forward port branch saas-15 up to c0ec09e9d5 2017-07-28 18:11:07 +02:00
Christophe Simonis be77cf7f5f [MERGE] forward port branch 10.0 up to e686385138 2017-07-28 16:56:14 +02:00
Christophe Simonis 97bac8d64c [IMP] core: capture Warnings though logging 2017-07-27 22:35:47 +02:00
Christophe Simonis 4f501348c4 [MERGE] forward port branch saas-16 up to 46e1104ce1 2017-07-26 19:55:44 +02:00
Christophe Simonis 46e1104ce1 [MERGE] forward port branch saas-15 up to 681f03e309 2017-07-26 19:41:57 +02:00
Christophe Simonis c4e9b854ff [IMP] core: log bad queries as ERROR
Also adapt default config and config mapping.
2017-07-26 17:46:20 +02:00
Laurent Smet 3425752eac [REM] odoo/report: remove deprecated stuff
- RML Reports
- Webkit Reports (most part already removed by 13b9982c62)
- LocalService in netsvc.py
- rename attributes like rml_% to report_%
- rename ir.actions.report.xml to ir.actions.report
- allow rendering directly on an ir.actions.report by calling render method
- remove 'controller' report_type
- remove unused res.font stuff
- remove print_report method in models.py (not used)
- restore removed call to pdftotext process in test_reports
2017-05-08 09:22:56 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Yannick Tivisse 98cb4719db [REM] workflow: Remove workflow engine, documentation and tests 2016-11-23 11:52:39 +01:00
Raphael Collet 4a700d0ad9 [FIX] odoo: rename imports and adapt import hooks 2016-09-02 17:28:12 +02:00
Raphael Collet 9e64f9f951 [REF] openerp: move openerp to odoo 2016-09-02 17:28:12 +02:00