Fixed logging.
Moved configuration to env vars and sorted out compile issues.