You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.6 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  3. :alt: License: AGPL-3
  4. ==============
  5. JSON Logging
  6. ==============
  7. This addon allows to output the Odoo logs in JSON.
  8. It also add the possibility to log extra data in json in your log.
  9. See documentation of json logger here : https://github.com/madzak/python-json-logger
  10. Example:
  11. .. code-block:: python
  12. _logger.info('My Message', extra={
  13. 'my_extra_key_1': 'value_1',
  14. 'my_extra_key_2': 'value_2'})
  15. The key "extra" is a standard key of logger module so you can add this key and your log will work with or without this module (see documentation here : https://docs.python.org/2/library/logging.html#logging.Logger.debug)
  16. Configuration
  17. =============
  18. The json logging is activated with the environment variable
  19. ``ODOO_LOGGING_JSON`` set to ``1``.
  20. In order to have the logs from the start of the server, you should add
  21. ``logging_json`` in the ``--load`` flag or in the ``server_wide_modules``
  22. option in the configuration file.
  23. If you want to see the extra keys when you are developping in local
  24. but with the odoo logger output and not the JSON output
  25. you can add the environment variable ``ODOO_LOGGING_JSON_DEV`` set to ``1``.
  26. Note : ``ODOO_LOGGING_JSON_DEV`` and ``ODOO_LOGGING_JSON`` should be not set both to ``1``
  27. Known issues / Roadmap
  28. ======================
  29. * Completed the extraction (in regex) of interesting message to get more metric
  30. Bug Tracker
  31. ===========
  32. Bugs are tracked on `GitHub Issues
  33. <https://github.com/OCA/server-tools/issues>`_. In case of trouble, please
  34. check there if your issue has already been reported. If you spotted it first,
  35. help us smash it by providing detailed and welcomed feedback.
  36. Credits
  37. =======
  38. Images
  39. ------
  40. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  41. Contributors
  42. ------------
  43. * Guewen Baconnier <guewen.baconnier@camptocamp.com>
  44. * Sébastien BEAU <sebastien.beau@akretion.com>
  45. Funders
  46. -------
  47. The development of this module has been financially supported by:
  48. * Camptocamp
  49. * Akretion
  50. Maintainer
  51. ----------
  52. .. image:: https://odoo-community.org/logo.png
  53. :alt: Odoo Community Association
  54. :target: https://odoo-community.org
  55. This module is maintained by the OCA.
  56. OCA, or the Odoo Community Association, is a nonprofit organization whose
  57. mission is to support the collaborative development of Odoo features and
  58. promote its widespread use.
  59. To contribute to this module, please visit https://odoo-community.org.