Added headers to error log and a bit better formatting