induction training - log - pugong.mepugong.me/images/att/induction-training-just-log.pdfkey point of...
TRANSCRIPT
![Page 1: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/1.jpg)
JustlogPuGong
Induction trainingofDevTeam
![Page 2: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/2.jpg)
Agenda
• What’sLog
• Whatshouldbelogged
• Howtousethelog• Examplesof Log System
• Q&A
![Page 3: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/3.jpg)
What’sLog
• arecordofajourneymadebyashiporaircraft,detailingallevents,or
thebookinwhichitiskept
• (Computers)Anyofvariouschronologicalrecordsmadeconcerning
theuseofacomputersystem,thechangesmadetodata,etc.
• The logsareoftenmet
• Transaction Log�Binlog
• Operation Log• Application Log
![Page 4: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/4.jpg)
Aretheylog
•&���� ������*�� ,�
• Black-box
![Page 5: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/5.jpg)
Keypointoflog
• Timestamp
• Sequence• Meaningful
• Formatofrecords
• Contents• Immutable
• StructuredvsUnstructured
![Page 6: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/6.jpg)
WhyLogareimportant
• Complianceandregulations:Provideanaudittrailofwho,what,
where,whenandwhy
• Situationalawareness• Incidentreponse• Realtimealerts
![Page 7: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/7.jpg)
Operationlog
• Purpose• Keepthetrackofwhatuserhaddone• ForAUDIT• ForTrackofrecordchange
• Keyelements
• When - Timestamp
• Who- User
• What- whatwasdid
• Where- IP/Host
• Identifier- Table(moudle)Name,record_id
![Page 8: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/8.jpg)
SampleofOperationLog
![Page 9: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/9.jpg)
Applicationlog
• Purpose• Keepnecessaryapplicationrunninginformation
• Foronlineproblemanalysis
• Fordebug• Keyelements
• When- Timestamp
• What
• LogLevel
• (Error)Message
• Stacktrace
• Where– Host/IP
• Secure– removesensitiveinformation
• Centralize
![Page 10: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/10.jpg)
LogLevel
• Debug:Usedonlyfordevelopmentandtesting.Temporaryopenon
productiontofindmoreinformation.(Cautionwiththelogsize)
• Information:Usedtokeeptheinformationthatisusefulforsystem
runningandmanagement. Theentryandexitpointsofkeyfunctions
shouldbekeptinthislevel.
• Warning:Usedtokeepthehandledexceptionsorotherimportantlogevents.
• Error:Usedtokeeptheunhandledexceptions• Fatal:Reservedforspecialexceptions/conditionsthatneedtobetakencareof.
![Page 11: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/11.jpg)
SampleofApplicationLog
![Page 12: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/12.jpg)
Howtolog- Metriclog
• Purpose• KeepApplicationrunningstat,mainlynumbersaboutbusiness
• Monitor
• Alert• Keyelement
• When– Timestamp
• Who– AppIdentifier
• Where– Host/IP/Tags
• What- Metrics
![Page 13: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/13.jpg)
SampleofMetricLog
![Page 14: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/14.jpg)
Howtolog- TraceLog
• Purpose• AnuniqueIdtolinkthelogsindifferentapplication
• Generatedattheverybeginningattherequest
• Saveineverylogsasafieldoratag
• Onlineproblemanalysis
• Userbehaviortracking• KeyElements
• What– uniquetracke Idinotherlog
• Others– almostthesameas
![Page 15: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/15.jpg)
Howtousethelogs
• Metricsformonitorandalert
• Wherealertsrings,gotoapplicationlogfordetailinformation
• Usetracetofindassociationlogsinotherappisnecessary
• Prediction
![Page 16: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/16.jpg)
Howtouselogs
Collect
Alert
Store
Search,
Report,
Analytics
Make
conclusions
Act
Humansneeded!
Files,syslog,etc
SMS,E-mail,etc
Immutablelogs
![Page 17: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/17.jpg)
LogSystem
• ELK– Metrics,applicationlogetc
• Statsd+Grafana /statsd +graphite– Metrics
• Splunk – commercial
• Customized
![Page 18: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/18.jpg)
ELK
Watcher Shield
![Page 19: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/19.jpg)
Splunk
![Page 20: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/20.jpg)
StatSD +Grafana
![Page 21: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/21.jpg)
ACustimized Logsystemarchitecture
![Page 22: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/22.jpg)
Logagent
![Page 23: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/23.jpg)
SumUp
• Carefulchooseloglevel• Centralizethelogs• Securethelogs
• DoLog• DoUsethelog:
• Monitor&Alert
• Analysisthelogs
![Page 24: Induction training - Log - pugong.mepugong.me/images/att/induction-training-just-log.pdfKey point of log • Timestamp • Sequence • Meaningful • Format of records • Contents](https://reader031.vdocument.in/reader031/viewer/2022020319/5e03f39ec0c48043c727a50d/html5/thumbnails/24.jpg)
Reference
• TheLog:Whateverysoftwareengineershouldknowaboutreal-timedata's
unifyingabstraction
• ���!�(��$�+�'#)"������"%���• LogEverythingAllTheTime
• http://play.grafana.org/• ElasticSearch,Logstash&Kibana• Splunk:http://www.splunk.com/
• Zabbix:https://www.zabbix.com/
• Cacti:http://cacti.net/• nagios:https://www.nagios.org/