Log Formatting, Error handling