More accurate logging set up, close #2284