Set up logging functionality earlier