SlideShare a Scribd company logo
1 of 95
Download to read offline
Logging Best
Practices
Avoid the rainforest killing rinse
repeat CI/CD Process
Shai Almog
@debugagent
Shai Almog
@debugagent
Act 1: What’s the Problem?
Shai Almog
@debugagent
Shai Almog
@debugagent
“Debugging is like being the
detective in a crime movie where
you are also the murderer.” –
Filipe Fortes
Shai Almog
@debugagent
Shai Almog
@debugagent
Logging can solve the mystery
Shai Almog
@debugagent
Shai Almog
@debugagent
Logging is a team effort
Shai Almog
@debugagent
Shai Almog
@debugagent
Bad Logging Is Murder!
Shai Almog
@debugagent
https://www.reddit.com/r/devops/comments/udgohy/
comment/i6i3oyo
Shai Almog
@debugagent
Shai Almog
@debugagent
Overlogging
Shai Almog
@debugagent
Shai Almog
@debugagent
Overlogging
✓ Increases Costs
Shai Almog
@debugagent
Overlogging
✓ Increases Costs
✓ Kills Performance
Shai Almog
@debugagent
Overlogging
✓ Increases Costs
✓ Kills Performance
✓ Kills readability
Shai Almog
@debugagent
Overlogging
✓ Increases Costs
✓ Kills Performance
✓ Kills readability
✓ Destroys the Environment
Shai Almog
@debugagent
Overlogging
Shai Almog
@debugagent
Insufficient Logging
Shai Almog
@debugagent
Shai Almog
@debugagent
Insufficient Logging
✓ Slow fixes, lost revenue
Shai Almog
@debugagent
Insufficient Logging
✓ Slow fixes, lost revenue
✓ CI/CD cycle of death!
Shai Almog
@debugagent
Insufficient Logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Solution - Company Standard
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Suggestions - not RULES!
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Act 2: Basics
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Don’t Roll Out Your Own!
Shai Almog
@debugagent
https://xkcd.com/927/ https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Keep the Log Message Short
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Logs MUST be Unique Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Avoid Logs in a Loop Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Don't Log Lists or Arrays
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
Log Stuff you Already "Have"
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Callback interfaces still suck! Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Don't Log Stuff that’s Already
There
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Focus on Method Exit Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Act 3: Culture
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Read the Log File
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Clearly Define the Logging Levels
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Clearly Define the Logging Levels
https://talktotheduck.dev/logging
✓ Errors - Something failed
✓ Warnings - Failure, but it wasn't critical
✓ Info - Interesting stuff
✓ Debug - Probably redundant, but I’m
not sure
Clearly Define the Logging Levels
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Don't Integration Test
Log Values
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Don't Double Log e.g. Errors!
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Log Less, Augment Later
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Act 4: Security
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Don't Log Unsanitized User Data
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Use PII Reduction
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Act 5: MDC
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Don’t Crowd the MDC
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Handle Everything in One Class
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Plan for Failure e.g. Thread Pool
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Act 6: OPS
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Asynchronous Logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
LogLevel = Warnings
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Don't Log Differently in Testing
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Shai Almog
@debugagent
https://talktotheduck.dev/logging
Summary
Shai Almog
@debugagent
https://talktotheduck.dev/logging
✓ We need to define a log
standard
Shai Almog
@debugagent
Summary
https://talktotheduck.dev/logging
✓ We need to define a log
standard
✓ Logs should be readable and
minimal
Shai Almog
@debugagent
Summary
https://talktotheduck.dev/logging
Questions? Shai Almog
Developer Advocate @ Lightrun
twitter.com/debugagent
talktotheduck.dev
github.com/shai-almog
shaia@lightrun.com
https://talktotheduck.dev/logging

More Related Content

More from Shai Almog

Cloud Native Debugging in Production - Dig Deep into your agents
Cloud Native Debugging in Production - Dig Deep into your agentsCloud Native Debugging in Production - Dig Deep into your agents
Cloud Native Debugging in Production - Dig Deep into your agentsShai Almog
 
How do i - localization and internationalization (l10n, i18n)
How do i - localization and internationalization (l10n, i18n)How do i - localization and internationalization (l10n, i18n)
How do i - localization and internationalization (l10n, i18n)Shai Almog
 
How do i - create a native interface
How do i -  create a native interfaceHow do i -  create a native interface
How do i - create a native interfaceShai Almog
 
5 Amazing Features in Codename One 3.7
5 Amazing Features in Codename One 3.75 Amazing Features in Codename One 3.7
5 Amazing Features in Codename One 3.7Shai Almog
 
Understand Properties in Codename One
Understand Properties in Codename One Understand Properties in Codename One
Understand Properties in Codename One Shai Almog
 
What is codename one
What is codename oneWhat is codename one
What is codename oneShai Almog
 
How To Use The Codename One Sources
How To Use The Codename One SourcesHow To Use The Codename One Sources
How To Use The Codename One SourcesShai Almog
 
Codename one Cordova/PhoneGap Support
Codename one Cordova/PhoneGap SupportCodename one Cordova/PhoneGap Support
Codename one Cordova/PhoneGap SupportShai Almog
 
Public showcase
Public showcasePublic showcase
Public showcaseShai Almog
 

More from Shai Almog (9)

Cloud Native Debugging in Production - Dig Deep into your agents
Cloud Native Debugging in Production - Dig Deep into your agentsCloud Native Debugging in Production - Dig Deep into your agents
Cloud Native Debugging in Production - Dig Deep into your agents
 
How do i - localization and internationalization (l10n, i18n)
How do i - localization and internationalization (l10n, i18n)How do i - localization and internationalization (l10n, i18n)
How do i - localization and internationalization (l10n, i18n)
 
How do i - create a native interface
How do i -  create a native interfaceHow do i -  create a native interface
How do i - create a native interface
 
5 Amazing Features in Codename One 3.7
5 Amazing Features in Codename One 3.75 Amazing Features in Codename One 3.7
5 Amazing Features in Codename One 3.7
 
Understand Properties in Codename One
Understand Properties in Codename One Understand Properties in Codename One
Understand Properties in Codename One
 
What is codename one
What is codename oneWhat is codename one
What is codename one
 
How To Use The Codename One Sources
How To Use The Codename One SourcesHow To Use The Codename One Sources
How To Use The Codename One Sources
 
Codename one Cordova/PhoneGap Support
Codename one Cordova/PhoneGap SupportCodename one Cordova/PhoneGap Support
Codename one Cordova/PhoneGap Support
 
Public showcase
Public showcasePublic showcase
Public showcase
 

Recently uploaded

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Logging Best Practices - Avoid the rinse repeat CI/CD Process