Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think this is a good overview, I especially like "descriptive, contextual, reactive." I like to ask "who is going to see this message and why? What action should they take?"

I've also come to find a few "wide" log entries significantly better than having many smaller log messages (especially as the system grows).

Ideally, one operation == one log message, and contains all context: userid, sessionid, url path, domain, error codes/messages, timing, etc. log error/warning if it fails, info if success. It's much easier to follow than one operation spread across a half dozen log messages. In dev, with one thing happening at a time, it's no big deal, but in production there's way more stuff happening and it is interspersed with hundreds of lines of logs of other operations as well as other threads running the same operation concurrently.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: