This question has been flagged

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.

Avatar
Discard