move child log truncation out of main loop into child init