[No reviewer] Set up logging functionality earlier and add more logs to memento

Tested live