redirect error statistics to file