Improve logging.

Change to default logging variable (global).
Set log file and logging level.
Fix json objects being logged as metadata - now json files are logged as a part of the log message.