Optimize CreateEnv by not creating the logging manager instance if env instance has already been created. (#4583)
* Optimize CreateEnv by not creating the logging manager instance if env instance has already been created.
* Move creation of logging mgr inside if block