copy from mailgun/gotools-log