Initialize logging as very first call in main

This fixes missing log outputs