Use setvbuf(3) to manage a larger-than-default buffer for reading the logs.