Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Are logs a software engineer’s best friend? Yes -- follow these best practices


Published on

Logs are an integral part of building happy, robust and scalable software, One of the common ways your application communicates back to you is in the form of logs and alerts. With application logs, you can unveil new insights about what is happening in your application in any environment. Logging is language and framework agnostic. You can get started with logging in a matter of minutes with cloud-based SAAS. At THE ICONIC, one of the most popular fashion e-commerce in Australia, we heavily use logging and instrumentation to get insights about our application's operation. In this session, I will uncover logging best practices, some situations where logging helped us find bugs early, solve difficult problems in time and keep the successful business up and running smoothly.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Are logs a software engineer’s best friend? Yes -- follow these best practices

  1. 1. Are logs a software engineer’s best friend? Yes -- follow these best practices Geshan Manandhar Senior Software Engineer (THE ICONIC) @geshan
  2. 2. ◉ Senior Software Engineer ○ Tech solution provider ◉ Agile follower ◉ Conditional microservices believer whoami
  3. 3. I am from Kathmandu, Nepal
  4. 4. I work at THE ICONIC
  5. 5. ◉ What is application log? ◉ Why log from the application level ◉ Tools of the trade -- How? ◉ Logging Best practices ◉ Key Takeaways ◉ Demo Agenda
  6. 6. What is application log?
  7. 7. “ “Logs are the stream of aggregated, time-ordered events collected from the output streams of all running processes and backing services.” - Source:
  8. 8. “ “An application log is a file of events that are logged by a software application. It contains errors, informational events and warnings.” - Technopedia Source:
  9. 9. Application logs are like having the right reading glasses
  10. 10. Why log from application level?
  11. 11. “ “The feature I deployed to production last week was working fine till yesterday, but now I have no idea why it is not working!” - One of us
  12. 12. Logs help to pinpoint the exact place where the software is not working as expected
  13. 13. To stop speculating and figure out the real data and metrics on any env
  14. 14. Logs are one of the ways your app communicates back to you
  15. 15. Even if you land into a mess, you know a way to sort things fast (MTTR)
  16. 16. Having proper logs is like having a torch in a dark place
  17. 17. Tools of the trade -- How?
  18. 18. Please don’t hammer the screw :)
  19. 19. Simplified components of logging Application generates logs Software that parses, analyzes and shows logsLogs are ingested Using a library or over https Software Engineer views/searches logs Local File / Stdout Logs are shipped/ingested with an agent or log shipper
  20. 20. Use a trusted logging library Language Library Github stars PHP Monolog ~16.0k TypeScript/JS Winston ~14.2k Python Native N/A Note: Don’t forget about monolog handlers and formatters :)
  21. 21. Use a trustworthy software to view and search your logs Self Hosted SAAS Cloud Provider Based
  22. 22. No tail -f ..., a good UI to view/search logs will make your life a lot easier
  23. 23. Logging best practices
  24. 24. Log information optimally Too Much = noise, too less = inadequate information
  25. 25. Always follow logs severity standards Emergency = phone rings at 1 AM, Info = good to know RFC-5425 (8 Levels) Emergency Alert Critical Error Warning Notice Info Debug
  26. 26. Structure your logs Structured logs are easier to parse and search, always provide context.
  27. 27. Don’t hamper speed and performance Write logs locally or async as far as possible, may be use a queue and consumer.
  28. 28. Add traceability for microservices Same request ID travels across services. Ability for distributed tracing.
  29. 29. Do not log sensitive information Like passwords, credit card information, phone numbers etc
  30. 30. Key Takeaways
  31. 31. Start logging today
  32. 32. It is easier than you think and benefits outweigh the cost
  33. 33. Logs can reveal things you didn’t know existed at unexpected sources
  34. 34. Logging > error tracking, it keeps a track of your application health
  35. 35. Find the right tools, invest in a log management software that suits your needs.
  36. 36. Logs with optimally configured alerts are very powerful
  37. 37. Demo ● ● Pull Request - PR
  38. 38. Logs are an integral part of building happy, robust and scalable software
  39. 39. Any questions? THE ICONIC is hiring - Engineering Manager You can find me at ◉ @geshan ( ◉ ◉ Slides: Thanks! Presentation template by SlidesCarnival
  40. 40. Credits/References ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉ ◉