Odoo Help

1

log handling in openerp

By
Viktor Nagy
on 9/7/14, 9:08 AM 1,187 views

I would like to set up my openerp to log to Sentry. Until now I've found two approaches, but both need touching the openerp core. As a result, I would like to come up with an idea that is sustainable and would be accepted as a patch for the core logging.

Here are my two proposals:

1. Use dictConfig to set up logging
 

In this case I would like to add another elif branch when loggers are set up. This branch would load a dict from a file specified by a config variable.

e.g.
in the openerp rc file::
 

log_dictlog = /path/to/dictConfig.py
 

in netsvc.py::
 

elif tools.config.get('log_dictlog'):

  from ... dictConfig import LOGGING

  from logging.conf import dictConfig

  dictConfig(LOGGING)
 

This is a highly customizable option that works for all kinds of setups, and I would definitely favor this instead of the next approach. (e.g. I can add log processors not to submit passwords)

 

2. Allow fine-tuning the syslog handler

Currently the syslog handler always logs to /dev/log. How can I separate my openerp instance logs from other syslogs? Not easily.

On the other hand, if I would be allowed to set the path of the syslog server, then I could use something like https://gist.github.com/avoine/2912777 for example.

This means that changing the config value of syslog from boolean to string, and the given string would define the syslog address. Unfortunately, this is still not perfect, as the address for the syslog handler is to be specified as (address, port) list.

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: 9/7/14, 9:08 AM
Seen: 1187 times
Last updated: 8/16/16, 3:32 AM