Intead of a seperate [logcurl] section in /etc/contrail/vnc_api_lib.ini, it is now enough to configure a curl log file against variable "curl_log" in the global section. ================================================================================== Added a small function to log the equivalent curl API calls to a log file whenever vnc api call is made
Intead of a seperate [logcurl] section in /etc/contrail/vnc_api_lib.ini,
it is now enough to configure a curl log file against variable
"curl_log" in the global section.
==================================================================================
Added a small function to log the equivalent curl API calls to a log file whenever vnc api call is made

- Can be turned on by setting following options in /etc/contrail/vnc_api_lib.ini. By default turned off and the logfile name is optional.
        [logcurl]
        is_logging=True
        logfile=/var/log/contrail/api_log_curl.log
- Whenever the logcurl:is_logging option is turned on, logging object for curl logging is initialized through function "_cfg_curl_logging" which will add the logging handler like filename, format etc. The reason for using seperate handler was because the logging object which was already defined in vnc_api.py was not working for some reason and also wanted to use a seperate log file instead of interfering with existing log files.
- Once logging handler is initialized the curl command string is constructed in function "_log_curl" and this function is called just before the actual REST API server call is made in the "_request" function again after making sure that curl logging is set to true in /etc/contrail/vnc_api_lib.ini.

Change-Id: I3c6235cc65ad8821f5425a79f5fc2db959f40179
Closes-Bug:1606411

tcpcloud/contrail-controller,tcpcloud/contrail-controller,tcpcloud/contrail-controller,tcpcloud/contrail-controller,tcpcloud/contrail-controller,tcpcloud/contrail-controller