Added support for environment variable to force logging.