Add logging and environment variables retrieval