Hacker News new | past | comments | ask | show | jobs | submit login

The deal with good logging is that good structured code makes debugging with logging easier.

The unsaid rule - If you're into async and suddenly printing a bunch of messages, logging will not help you. :)




Log synchronously. Either exploit the POSIX propensity of buffering lines, have an explicit synchronization on your IO routine (that doesn't need to stop the business code), or log each thread to a different stream.


Why would logging not help in an async flow? Link log entries with request IDs and consider structured logs. I analyze logs in massively concurrent systems all the time.




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

Search: