Odoo Help

Welcome!

This community 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.

1

log handling in openerp

By
Viktor Nagy
on 9/7/14, 9:08 AM 978 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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/7/14, 9:08 AM
Seen: 978 times
Last updated: 8/16/16, 3:32 AM