Commit Graph

131 Commits

Author SHA1 Message Date
Denis Ledoux 547204b7f4 [IMP] logging: store logs in database in multi databases env.
The server parameter `log-db` gives the possibility
to store the logs of a server in a specific database,
in the ir.logging model.

Unfortunately, it wasn't possible to store these logs within
the database from which the logs came from in a multi databases
environment (e.g. the SAAS).

This revision gives the possibility to store the logs
within the database where the logs come from,
using --log-db=%d (inspired from the --db-filter arg)

We also added the possibility to change the level of logs to store in
the database, with the --log-db-level argument, which is set
by default to `warning`.
2015-05-07 15:11:58 +02:00
Samus CTO fb285d8695 [FIX] prevent unneeded chmod datadir, but check writable 2015-02-27 17:16:16 +01:00
Xavier Morel 426bcf427c [FIX] incorrect serialisation of log_handler
Saving log_handler to the config file is not currently special-cased,
the value is thus dumped as the repr() of the list, but not deserialized
with literal_eval. This means -s breaks log_handler and the
configuration file example is incorrect (it looks like a list).

Repeated -s further break the log_handler by interpreting the original
value as a string, putting it into a list, then reserialising that with
repr(), injecting a bunch of escaping backslash. The config file is soon
filled with backslashes and doubles in size with each new -s.

Furthermore for some reason the whole thing breaks --log-handler (and
aliases) entirely, once the wrong log_handler has been saved none of
them works anymore.

Fixes #4552
Closes #4157
2015-01-27 13:58:12 +01:00
Xavier Morel e9f0d79f85 [IMP] config: deduplicate loggers in log_handler
Saving multiple levels for the same logger should work with few issues,
but over time pathological (basket) cases (e.g. using ``-s`` all the
time) may build pointlessly huge lists in their config file.

Only keep the last level for each logger when saving to a config file.
2015-01-27 12:35:53 +01:00
Xavier Morel 8641826ca4 [IMP] config: make log_handler and --log-handler additive
For log_handler (list of logger configuration specs), having the
configuration file and the CLI configuration be exclusive (one
overwriting the other) is detrimental: it precludes keeping the
configuration file as a convenient baseline and only altering the subset
of loggers of interest at any given time. Combine specs from both
sources instead of overwriting one with the other.

* remove log_handler and its special case from the first options loop
* remove seeding of option with DEFAULT_LOG_HANDLER
* my_default is the baseline "configuration file" value, it's None if
  not provided which is not convenient. Use DEFAULT_LOG_HANDLER for it
  as baseline configuration file. DEFAULT_LOG_HANDLER isn't a list
  anymore, it's a CSV of logger specs (same as file-serialized)
* could actually use a DEFAULT_LOG_HANDLER of ``:`` (the default logger
  is root, the default level is info), but that might be a tad too
  cryptic
* things are weird between my_default and the file-sourced value,
  _parse_config is first run with my_defaults then with the file, but if
  there's no file it's re-run with already-parsed my_defaults. So when
  the file and the command-line values are of different type,
  _parse_config must be ready to handle both
2015-01-27 12:35:52 +01:00
Xavier Morel 9f4dea0891 [FIX] config: correctly serialize log_handler to CSV 2015-01-27 12:35:52 +01:00
Xavier Morel 23ad48a91b [FIX] config: a list is always equal to itself
add_option(action=append*) always modifies the ``default`` list
in-place. When using DEFAULT_LOG_HANDLER directly, that means
log_handler is always equal to DEFAULT_LOG_HANDLER since they're the
same list object. Thus the --log-handler command-line would never
overwrite the log_handler value from the configuration file, which is
unexpected

Fix that by copying DEFAULT_LOG_HANDLER before passing it as the
option's default value.
2015-01-27 12:35:51 +01:00
Denis Ledoux 4c1908088c [MERGE] forward port of branch saas-3 up to 879fca0 2015-01-06 19:00:08 +01:00
Denis Ledoux 879fca0856 [MERGE] forward port of branch 7.0 up to 9191115 2015-01-06 18:56:10 +01:00
Martin Trigaux ae34a1e93e [IMP] config: remove deprecated comment
It was intended to be replaced by log-handler at first but log-level is still
a very convenient way to manage the level of debug.
2015-01-06 18:03:58 +01:00
Georges Racinet 9dad29caaf Reintroduce fname kwarg in configmanager
In [f04f409], the configmanager's __init__ lost its fname kwarg, which
allows to pass the name of the config file to read (or write).
Without it the only way to programmatically specify this file name is to
use the OPENERP_SERVER environment variable, which may be unpractical and/or
subject to renaming.

External tools (such as the buildout recipe) may need to pass this file in a
clean way.
2014-12-16 12:54:16 +01:00
Xavier Morel f04f409943 [ADD] doc: setup documentation
* Odoo installation from packages or source
* Deployment instructions for production environments
* dbfilter

Add missing support for disabling xmlrpc(/http), useful for WSGI
deployments which require running cron-only Odoo instances.
2014-12-15 16:01:37 +01:00
Xavier Morel a2115ef544 [FIX] ensure default addon paths are valid (existing)
User-provided addons paths are checked for existence (and rejected), but
default addons paths are not checked, and blow up when trying to listdir
them (e.g. when http.py tries to load modules).

This is an issue when using Odoo from the distributed tarballs, because
the packaging currently moves all modules to openerp/addons and removes
the root ("main") addons directory.
2014-12-05 19:12:33 +01:00
Christophe Simonis 89eaa8a8a8 [MERGE] forward port of branch saas-3 up to 309ca4f 2014-10-24 17:25:19 +02:00
Christophe Simonis 309ca4fcf7 [MERGE] forward port of branch 7.0 up to d2fd05e 2014-10-24 16:52:10 +02:00
Samus CTO d2fd05ef21 [IMP] config: Test that the config file is readable
Fixes #3237

cherry-pick of 8e72049
2014-10-24 16:48:27 +02:00
Olivier Dony 2bdbe255a7 [FIX] config: fix parsing of geoip db paramater, rename command-line option for consistency 2014-10-15 17:26:54 +02:00
Jeremy Kersten c8e14f301f [FIX] GeoIP - allow to specify the path to GeoIP in the server config.
--geoip_db='the_path'  which can be used via openerp.tool.config['geoip_database']
2014-10-13 16:47:12 +02:00
Christophe Simonis 80a932479b FIX] packaging: odoo-ification 2014-09-04 16:27:58 +02:00
Simon Lejeune 7e41903110 [FIX] config.py: do not use appsdir to define the user's data dir when he has no home directory on unix
Force it to be '/var/lib/(appname)' in this case
2014-09-02 14:13:00 +02:00
rlu-odoo 8b67a7202d [REF] OpenERP --> Odoo in various UI texts
Rebranding has been done in:
- data/demo files
- html templates
- help notices
- comments
- logger messages
- and other various messages

(Commit taken from odoo-dev:8.0-improve-openerp-odoo-rlu at rev 7deaa08)

Closes #1260
2014-07-18 13:45:41 +02:00
Christophe Simonis a35aec2a0b [MERGE] forward port of branch 7.0 up to 6e96ffd 2014-07-10 22:02:01 +02:00
Fabien Meghazi c0aa86b9ab [FIX] configuration file dbfilter's option has no effect
lp bug: https://launchpad.net/bugs/940439 fixed

bzr revid: fme@openerp.com-20140508075025-yszqmzie1z4n7l4j
2014-07-07 18:08:31 +02:00
Christophe Simonis e5b0933743 [FIX] data-dir management
- sessions are now shared between series.
- use site data dir instead of user data dir if user has no home dir.
- in http and module handling, `data-dir` was used before being
initialized, using the default value instead of user input

(fixes #308, #904)
2014-07-07 15:49:24 +02:00
Fabien Meghazi 05f376e310 If no addons-path provided, include the main addons 2014-05-20 22:33:49 +02:00
Fabien Meghazi cf87afbe0a [FIX] configuration file dbfilter's option has no effect
lp bug: https://launchpad.net/bugs/940439 fixed

bzr revid: fme@openerp.com-20140508075025-yszqmzie1z4n7l4j
2014-05-08 09:50:25 +02:00
Antony Lesuisse 483bc96682 [IMP] wsgi and http cleanups, static http is now handled in http.py
bzr revid: al@openerp.com-20140326132057-scuiqvqma9dhyorl
2014-03-26 14:20:57 +01:00
Christophe Simonis 5b2634bd6e [FIX] init logger earlier, right after config loading
bzr revid: chs@openerp.com-20140325154627-cmodvx26jayj3k4a
2014-03-25 16:46:27 +01:00
Christophe Simonis fdd1f69294 [FIX] duplicate/rename/drop database: handle filestore
bzr revid: chs@openerp.com-20140321155659-gvg4br76214lur4l
2014-03-21 16:56:59 +01:00
Antony Lesuisse e73230d0fc ir_logging fix logger names
bzr revid: al@openerp.com-20140320000912-1a5hngnw8ilq22k8
2014-03-20 01:09:12 +01:00
Antony Lesuisse 6e4db0a0a6 ir_logging fix config option
bzr revid: al@openerp.com-20140320000524-gs98xy6iqh2ceev6
2014-03-20 01:05:24 +01:00
Antony Lesuisse e9d047e611 sql loggin cleanups
- prepare for netsvc will be renamed to logging
- move back log from http.py has it's used by the cron
- move sql handler to netsvc, simplify to use sql_db
- remove unused handler
- close plaform specific #ifdef pandora's box

bzr revid: al@openerp.com-20140316182933-jkcji9yqfbsokcmg
2014-03-16 19:29:33 +01:00
Stephane Wirtel 4bbcfddc13 [MERGE] from trunk
bzr revid: stw@openerp.com-20140312102948-1n3b2d1vqedzojzb
2014-03-12 11:29:48 +01:00
Christophe Simonis ec36a494fe [FIX] do not expose posix only config options on windows
bzr revid: chs@openerp.com-20140306115214-8wrfivy4runpzoar
2014-03-06 12:52:14 +01:00
Stephane Wirtel 5918ad323e [MERGE] from Trunk
bzr revid: stw@openerp.com-20140228161338-8yjlkwacuube7vir
2014-02-28 17:13:38 +01:00
Stephane Wirtel 047d071a48 [IMP] Add a new Logging Handler, where we will store in the database of OpenERP.
this database can be overrided via the --log-pgsql-database

bzr revid: stw@openerp.com-20140228161147-s9nnrfq2tc94vq5p
2014-02-28 17:11:47 +01:00
Antony Lesuisse 8fec899f9b [FIX] move appsdirs to tools
bzr revid: al@openerp.com-20140227163259-asal833qjv3gylit
2014-02-27 17:32:59 +01:00
Antony Lesuisse 38d1ca1ff2 [MERGE] trunk
bzr revid: al@openerp.com-20140227161819-p9chmskfifo0rygs
2014-02-27 17:18:19 +01:00
openerp-sle 3ef93918a8 [FIX] Increased allowed virtual memory per worker
bzr revid: openerp-sle@openerp-sle.home-20140212225240-nhu8dj68z84rm9u5
2014-02-12 23:52:40 +01:00
Antony Lesuisse 002ac937c1 add python --test-file support
bzr revid: al@openerp.com-20140209014636-2fbl15q8wrubmiup
2014-02-09 02:46:36 +01:00
Christophe Simonis c48f11041b [IMP] chmod data-dir
bzr revid: chs@openerp.com-20140116164406-p2gtb2uziwhchp68
2014-01-16 17:44:06 +01:00
Christophe Simonis db10e1d3a5 [FIX] http: store sessions in data-dir
bzr revid: chs@openerp.com-20140116164142-ikcw82lyfopoj46k
2014-01-16 17:41:42 +01:00
Christophe Simonis a73c02075a [FIX] ensure data-dir (and subdirs) exists
bzr revid: chs@openerp.com-20140116100243-ltp6yunvm1bnvn5q
2014-01-16 11:02:43 +01:00
Christophe Simonis 5d87753ef2 [ADD] new cli argument: -D/--data-dir
bzr revid: chs@openerp.com-20140115171323-eiy2h61qi098n0q3
2014-01-15 18:13:23 +01:00
Antony Lesuisse 40ba925691 [IMP] --auto-reload to enable code and xml auto reload, service cleanup.
Added an autoreload mecanism based on pyinotify that restart the server as soon
as a .py or .xml file change is detected, for xml updates the relevant -u are
automatically added to exec(2).

pyinotify is linux specific and should be replaced by a cross plaform library
such as watchdog. Unfortunatly watchdog is not yet packaged in debian. We could
support both libraries, patches are welcome.

Refactored the code in cli/* and service/*. The 3 running modes of openerp
(threaded, prefork, gevent) are now in openerp/service/server.py, one class per
mode, and they share the same interface.

Added a signal handler to increase or decrase the number of HTTP workers in
prefork mode (SIGTTIN, SIGTTOU).

bzr revid: al@openerp.com-20131005225740-hrxwy50ldi5yql0e
2013-10-06 00:57:40 +02:00
Antony Lesuisse 0a75a6b5ff simplier autoreload working
bzr revid: al@openerp.com-20131005212240-5lp8tgwukeg5wwdq
2013-10-05 23:22:40 +02:00
Antony Lesuisse 2a6d0299d9 revert to use a separate executable for gevent, add --dev option
bzr revid: al@openerp.com-20130909200825-sm5c3invmg7tt70j
2013-09-09 22:08:25 +02:00
Vo Minh Thu c3aae0abdb [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20130328095006-o01omst9g0uhm0iz
2013-03-28 10:50:06 +01:00
Vo Minh Thu 34e8deeb4e [REM] common: removed login_message() which is not used.
bzr revid: vmt@openerp.com-20130328093018-c4s19buicwwol8y2
2013-03-28 10:30:18 +01:00
Vo Minh Thu c313b4073a [REF] logging: removed pseudo log-level TEST.
When --test-enable is used, it is expected that test output is visible,
thus using log-level INFO is natural.

On the down side you lose the nice blue hint that tests did actually
run when --log-level test was given.

bzr revid: vmt@openerp.com-20130326155844-83e2tcqokvblr0ln
2013-03-26 16:58:44 +01:00