Add support for file logging in cli
More explicit log messages in api