setup logging and env vars