Agenda ◉ ◉ ◉ ◉ ◉ ◉
What is application log? Why log from the application level Tools of the trade — How? Logging Best practices Key Takeaways Demo
Slide 6
What is application log?
Slide 7
“Logs are the stream of aggregated, time-ordered events collected from the output streams of all running processes and backing services.” - 12Factor.net
“ Source: https://www.12factor.net/logs
Slide 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: https://www.techopedia.com/definition/1819/application-log
Slide 9
Application logs are like having the right reading glasses
Slide 10
Why log from application level?
Slide 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
“
Slide 12
Logs help to pinpoint the exact place where the software is not working as expected
Slide 13
To stop speculating and figure out the real data and metrics on any env
Slide 14
Logs are one of the ways your app communicates back to you
Slide 15
Even if you land into a mess, you know a way to sort things fast (MTTR)
Slide 16
Having proper logs is like having a torch in a dark place
Slide 17
Tools of the trade — How?
Slide 18
Please don’t hammer the screw :)
Slide 19
Simplified components of logging
Application generates logs
Local File / Stdout
Logs are ingested Using a library or over https
Software that parses, analyzes and shows logs
Logs are shipped/ingested with an agent or log shipper
Software Engineer views/searches logs
Slide 20
Use a trusted logging library
Language
Library
Github stars
PHP
Monolog
~16.0k
TypeScript/JS
Winston
~14.2k
Native
N/A
Python
Note: Don’t forget about monolog handlers and formatters :)
Slide 21
Use a trustworthy software to view and search your logs
Self Hosted
SAAS
Cloud Provider Based
Slide 22
No tail -f …, a good UI to view/search logs will make your life a lot easier
Slide 23
Logging best practices
Slide 24
Log information optimally Too Much = noise, too less = inadequate information
Slide 25
RFC-5425 (8 Levels) Emergency Alert Critical Error Warning Notice Info Debug
Always follow logs severity standards Emergency = phone rings at 1 AM, Info = good to know
Slide 26
Structure your logs Structured logs are easier to parse and search, always provide context.
Slide 27
Don’t hamper speed and performance Write logs locally or async as far as possible, may be use a queue and consumer.
Slide 28
Add traceability for microservices Same request ID travels across services. Ability for distributed tracing.
Slide 29
Do not log sensitive information Like passwords, credit card information, phone numbers etc
Slide 30
Key Takeaways
Slide 31
Start logging today
Slide 32
It is easier than you think and benefits outweigh the cost
Slide 33
Logs can reveal things you didn’t know existed at unexpected sources
Slide 34
Logging > error tracking, it keeps a track of your application health
Slide 35
Find the right tools, invest in a log management software that suits your needs
Slide 36
Logs with optimally configured alerts are very powerful
Logs are an integral part of building happy, robust and scalable software
Slide 39
Thanks! Any questions? Later :) THE ICONIC is hiring - Engineering Manager You can find me at ◉ ◉ ◉
@geshan (geshan@gmail.com) Geshan.com.np Slides: bit.ly/logging-lau Presentation template by SlidesCarnival