Support logging configuration in OpenContrail

Registered by Numan Siddique on 2015-02-26

Presently much of the logging configuration in both C++ modules and Python modules
are hard coded. This blueprint proposes the mechanism to support logging configuration.

Python modules
---------------
This blueprint proposes
 1. to provide the modular mechanism to use other third party logging libraries like oslo.log or to define new ones.
 2. Enhance the sandesh logger to reading the logging parameters (like handlers, formatters etc) from the configuration file

The below approach can be taken to implement the suggested features.

  a. A base sandesh logger (SandeshBaseLogger) class needs to be defined
  b. sandesh_logger.SandeshLogger should be derived from SandeshBaseLogger
  c. External logging library should derive from SandeshBaseLogger class.
  d. External logging library needs to be outside the OpenContrail source tree and can be a pip package.
  d. The class name of the thirty party logging libraries has to be defined in a configuration file (eg. contrail-api.conf)
  e. class name needs to be passed to sandesh_base.Sandesh object
  f. Sandesh object needs to call a factory method (eg. SandeshBaseLogger.create_logger()) to create the logger class object.
  g. If external class name is not defined in the configuration file, then sandesh_base.Sandesh should use sandesh_logger.SandeshLogger class.
  h. Enhance the sandesh_logger.SandeshLogger to support the configuration function - logging.config.fileConfig()

C++ modules
------------
The logging module needs to be enhanced to read the logging parameters like log handlers, file size, enable syslog etc from configuration files.

Draft code is available here
---------------------------------
https://github.com/enovance/contrail-controller/commit/9b5a4909d7658b9c1d2a80fef6350d2d03ba2f3d

https://github.com/enovance/contrail-sandesh/commit/6d7477ac145b205ebbb59c65761ae605062a2ccc

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Numan Siddique
Direction:
Needs approval
Assignee:
Numan Siddique
Definition:
Review
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Nman Siddique has indicated that he cannot continue work on this blueprint.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.