SlideShare una empresa de Scribd logo
1 de 44
APPLICATION LOGGING
About ME Sander De Vos Software Engineer RealDolmen 2008 Past projects MaTMa (M*) E-Metro (FOD-ECO) SP10B (FOD-FIN) MIK (FOD-MOB)
QuotesFrom The Field “Whoneeds logs? Isuredon’t!” “Debugger is better! Sysoutworkstoo!” “Isn’tthatwhatinfrastructure does?” “It slows down disk and memory!” “It isn’t in the spec!” “We don’tknowwhatto log – we’lljust log something!” “We don’tknowhow – we’lljust do itsomehow!”
Agenda What is logging Definition andChallenges Whylogging Whouses logs What logs are usedfor Functional or non-functional Whatto log Whatwill (not) help you Log messagedecomposed Guidelines How to log in Java Logging in production Log processing and analysis
What is logging
Definition “Logs are the recordings of one or more events occurring on information systems.” “Logs can be organized based on the program, day, severity, host, or a number of other categories.“ “Logs may be referred to as log files, audit logs, or audit trails. Logs also cover alerts, alarms and event records.“
Log challenges Decentralization Cloud SOA Volatility Multiple tiersandlayers Archival Accessability Absence of critical information Random log formats
WHY logging
Whouses logs Managed Services Security Teams Monitor Detect Investigate Track Analyze Auditors Developers Debugging Customer
What logs are usedfor Debugging andForensics Fault monitoring Performance monitoring Troubleshooting Feature usage Security / Incident detection Regulatoryand standards compliance
Functional – non-functionallogging Functional Audit Governance Security Non-functional Faults, Errors, Exceptions Execution context Performance Component usage
Putting italltogether Functional Logs CustomerAudit Always on Requirements Scope known Years ‘Clutter, yuck, slow’ Non-Functional Logs System operatorDeveloper Sometimes on Errors, Exceptions, Debug Scope notknown Hours, Days ‘Mightcome in handy’
WHAT to log
Keep in mind ”Whatwouldhelp YOU at 3 AM in the morning? “ Image: Ambro / FreeDigitalPhotos.net
Whatwillhelp you Exact notice of whathappened When Where How Who Clearconcise context information Analysis possible without application Manual Semi-automated Automated Remotelycollectible files Low footprint Proven reliableandauthentic
Whatwill help youexamples 2011-05-31 08:46:11,308 +0200 INFO  [eventlog.security]  ACCESS OF ProfileServiceImpl.findProfilesBY [login: some_username]; Password: [PROTECTED]; Authenticated: true; Details: RemoteIpAddress: 192.168.156.17; SessionId: 8XyrNkLWv7FdXS… Granted Authorities:ROLE_USER,ROLE…
Whatwon’thelp you No details about the record No context information Inconsistent format or bad use Non-correlatable Subjective/interpretativemessage Too muchuseless log records Loggingtoone single big file
Whatwon’t help you – example#1 log4j: setFile called: ./logs/be/mobistar/network-status/log_functional.log, false log4j: setFileended tis nendefault tis nendefault Activations : 15 Deactivations : 0 In straigt to resource filter
Whatwon’t help you – example#2 INFO  [dao.ProductDao] [] - FOUND 40 INFO  [web.listeners.PhaseLogger] [] - +RENDER_RESPONSE INFO [service.ProductFamilyService] [] - product in family is true INFO  [.dao.ProfileDao] [] - [OBJECTS] find profiles
log messagedecomposed
“A log record shouldbeunderstandableby a human, andeasily machine processable.”
LoggingGuidelines: Priorities Fatal Application crash&burn Error Exceptions Monitoring team alert Warn Monitor health, performance Info Informative Context Audit trail Debug Extensive Context Development, Testing Troubleshooting
LoggingGuidelines: Exceptions Handling Recover Log the details ifcritical Not Handling, Translating Translate Handling logic ifnotpropagating Not Handling Propagate Someoneelsewill handle (and log!) Chooseexceptionsto log Defendfromstacktrace chaos Choosewhatto log foreachexception Catching block has all context details!
LoggingGuidelines: Correlation 1 transaction = * log records Correlationnecessary Executiontrail Shared context variable Shared per transaction Reuse of context variables Nested Diagnostic Context Map Diagnostic Context Onlyonecorrelation Use a context uniquevariable Correlate transactions
How to log iN
How loggingframeworkswork
Java Logging Frameworks Implementation System.out – System.err Redirect output Java UtilLogging Log4j Logback Abstraction CommonsLogging SLF4J
Java UtilLogging Java 1.4+ Based on Log4J Less features out of the box Console File Stream
Log4j First framework Introductionof Logger, Appender, Level Hiearchical Loggers Configurableappenders, e.g. MailAppender FileAppender SMTPAppender SocketAppender SyslogAppender Leader quitandstartedlogback
CommonsLogging Apache Project API Bridge API-calls forward to Log4j if on CP Falls back to JUL Plagued Double Configuration Runtime dependency check ClasspathScanning Discontinued v1.1.1 dates from end 2007
Slf4j - Logback Twolibrariestorulethemall Slf4j Comparablewithcommons-logging Parameter parsing Framework  bridges Much more powerful Logback Evolved log4j Implements Slf4j “Picking up where log4j leaves off” Testing Filters on-need-base
SLF4J Binding
SLF4J Bridging
Keepingit performant String concatenation LOGGER.debug("Hello " + name); Protected block if (logger.isDebugEnabled()) {LOGGER.debug("Hello " + name);} Slf4j LOGGER.debug("Hello {}", name);
Context Variables In Practice NDC.push(correlationId); app.logMe("Hello world!"); NDC.pop(); Use %x in Pattern ConversionPattern= %x %d %m %n correlationId 2011-06-21 09:20:41 [INFO] Hello world!
Specialized Loggers Logger for class Fine-tune log Executiontrace How distinguish Security Performance  Business Specialized Loggers Priorities Output handlers Groupedlogging
Logging In Production Onlynecessarylogging Situation -> turn on debuglogging No restart: DynamicReloading ‘Watch’ file for changes Log file management Rolling file Seperation of concerns Clustering Different systems generatemessages Synchronization of timestamps Correlation on host-specific files
My Opinion Importance of loggingwillgrow Mobile / offline applications Cloud integration System interaction Logging standards enterprisewide Standardization of logging effort Inexpensiveexercise Draft a standard Build adapters / patterns Enforce standards
Log Processing and analysis
Log Analysis Bang foryourbuck XpoLog http://www.xpolog.com Licensed Faster Splunk http://www.splunk.com Free Edition ‘Slow’ AJAX feel Nice graphics Modular (http://www.splunkbase.com) Tuningyourpattern is important?
Demo
For more information: visit our website WWW.REALDOLMEN.COM Follow us on: Selected presentations are available on: Thank You Or scan this QR code with your Smartphone to immediately go to the website

Más contenido relacionado

La actualidad más candente

S108283 svc-storwize-lagos-v1905d
S108283 svc-storwize-lagos-v1905dS108283 svc-storwize-lagos-v1905d
S108283 svc-storwize-lagos-v1905dTony Pearson
 
Secure code practices
Secure code practicesSecure code practices
Secure code practicesHina Rawal
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez YalonAdar Weidman
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVMRomain Schlick
 
Log management with ELK
Log management with ELKLog management with ELK
Log management with ELKGeert Pante
 
用 Drone 打造 輕量級容器持續交付平台
用 Drone 打造輕量級容器持續交付平台用 Drone 打造輕量級容器持續交付平台
用 Drone 打造 輕量級容器持續交付平台Bo-Yi Wu
 
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of QuarkusD. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of QuarkusUni Systems S.M.S.A.
 
Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Anton Chuvakin
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAPEDB
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkSVDevOps
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaPrajal Kulkarni
 
카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우if kakao
 
Role based access control - RBAC
Role based access control - RBACRole based access control - RBAC
Role based access control - RBACAjit Dadresa
 
PostgreSQL and JDBC: striving for high performance
PostgreSQL and JDBC: striving for high performancePostgreSQL and JDBC: striving for high performance
PostgreSQL and JDBC: striving for high performanceVladimir Sitnikov
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing TechniquesAvinash Thapa
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)TzahiArabov
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaJoe Stein
 

La actualidad más candente (20)

S108283 svc-storwize-lagos-v1905d
S108283 svc-storwize-lagos-v1905dS108283 svc-storwize-lagos-v1905d
S108283 svc-storwize-lagos-v1905d
 
Secure code practices
Secure code practicesSecure code practices
Secure code practices
 
Mysql-MHA
Mysql-MHAMysql-MHA
Mysql-MHA
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
 
Logstash
LogstashLogstash
Logstash
 
Discover Quarkus and GraalVM
Discover Quarkus and GraalVMDiscover Quarkus and GraalVM
Discover Quarkus and GraalVM
 
Log management with ELK
Log management with ELKLog management with ELK
Log management with ELK
 
用 Drone 打造 輕量級容器持續交付平台
用 Drone 打造輕量級容器持續交付平台用 Drone 打造輕量級容器持續交付平台
用 Drone 打造 輕量級容器持續交付平台
 
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of QuarkusD. Andreadis, Red Hat: Concepts and technical overview of Quarkus
D. Andreadis, Red Hat: Concepts and technical overview of Quarkus
 
Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAP
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우
 
Role based access control - RBAC
Role based access control - RBACRole based access control - RBAC
Role based access control - RBAC
 
PostgreSQL and JDBC: striving for high performance
PostgreSQL and JDBC: striving for high performancePostgreSQL and JDBC: striving for high performance
PostgreSQL and JDBC: striving for high performance
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)OWASP Top 10 2021 Presentation (Jul 2022)
OWASP Top 10 2021 Presentation (Jul 2022)
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 
Elk stack
Elk stackElk stack
Elk stack
 

Destacado

Spring Reference
Spring ReferenceSpring Reference
Spring ReferenceSyed Shahul
 
Log4j Logging Mechanism
Log4j Logging MechanismLog4j Logging Mechanism
Log4j Logging MechanismKunal Dabir
 
Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)Angelin R
 
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Oleksiy Panchenko
 

Destacado (6)

Spring Reference
Spring ReferenceSpring Reference
Spring Reference
 
Java logging
Java loggingJava logging
Java logging
 
Log4j Logging Mechanism
Log4j Logging MechanismLog4j Logging Mechanism
Log4j Logging Mechanism
 
Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)
 
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
Elasticsearch, Logstash, Kibana. Cool search, analytics, data mining and more...
 
Well logging
Well loggingWell logging
Well logging
 

Similar a Functional and non functional application logging

Log Standards & Future Trends by Dr. Anton Chuvakin
Log Standards & Future Trends by Dr. Anton ChuvakinLog Standards & Future Trends by Dr. Anton Chuvakin
Log Standards & Future Trends by Dr. Anton ChuvakinAnton Chuvakin
 
LogChaos: Challenges and Opportunities of Security Log Standardization
LogChaos: Challenges and Opportunities of Security Log StandardizationLogChaos: Challenges and Opportunities of Security Log Standardization
LogChaos: Challenges and Opportunities of Security Log StandardizationAnton Chuvakin
 
MojoPortal And Log4net
MojoPortal And Log4netMojoPortal And Log4net
MojoPortal And Log4netVerifiedAD.com
 
Six Mistakes of Log Management 2008
Six Mistakes of Log Management 2008Six Mistakes of Log Management 2008
Six Mistakes of Log Management 2008Anton Chuvakin
 
The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012DefCamp
 
From Monolith to Observable Microservices using DDD
From Monolith to Observable Microservices using DDDFrom Monolith to Observable Microservices using DDD
From Monolith to Observable Microservices using DDDMaria Gomez
 
Oksana Safronova - Will you detect it or not? How to check if security team i...
Oksana Safronova - Will you detect it or not? How to check if security team i...Oksana Safronova - Will you detect it or not? How to check if security team i...
Oksana Safronova - Will you detect it or not? How to check if security team i...NoNameCon
 
Developer Fundamentals - Logging
Developer Fundamentals - LoggingDeveloper Fundamentals - Logging
Developer Fundamentals - LoggingAxel Irriger
 
How to Use OWASP Security Logging
How to Use OWASP Security LoggingHow to Use OWASP Security Logging
How to Use OWASP Security LoggingMilton Smith
 
NIST 800-92 Log Management Guide in the Real World
NIST 800-92 Log Management Guide in the Real WorldNIST 800-92 Log Management Guide in the Real World
NIST 800-92 Log Management Guide in the Real WorldAnton Chuvakin
 
Praesidio - Log.error("impossible-")
Praesidio - Log.error("impossible-")Praesidio - Log.error("impossible-")
Praesidio - Log.error("impossible-")Nicholas Roberts
 
Tooling on distributed services
Tooling on distributed servicesTooling on distributed services
Tooling on distributed servicesHiraq Citra M
 
Making Logs Sexy Again: Can We Finally Lose The Regexes?
Making Logs Sexy Again: Can We Finally Lose The Regexes?Making Logs Sexy Again: Can We Finally Lose The Regexes?
Making Logs Sexy Again: Can We Finally Lose The Regexes?Anton Chuvakin
 
Security Practices - Logging.pptx
Security Practices - Logging.pptxSecurity Practices - Logging.pptx
Security Practices - Logging.pptxAlireza Vafi
 
Log Management Systems
Log Management SystemsLog Management Systems
Log Management SystemsMehdi Hamidi
 
TDC 2015 - POA - Trilha PHP - Shit Happens
TDC 2015 - POA - Trilha PHP - Shit HappensTDC 2015 - POA - Trilha PHP - Shit Happens
TDC 2015 - POA - Trilha PHP - Shit HappensJackson F. de A. Mafra
 
Shields up - improving web application security
Shields up - improving web application securityShields up - improving web application security
Shields up - improving web application securityKonstantin Mirin
 

Similar a Functional and non functional application logging (20)

Log Standards & Future Trends by Dr. Anton Chuvakin
Log Standards & Future Trends by Dr. Anton ChuvakinLog Standards & Future Trends by Dr. Anton Chuvakin
Log Standards & Future Trends by Dr. Anton Chuvakin
 
LogChaos: Challenges and Opportunities of Security Log Standardization
LogChaos: Challenges and Opportunities of Security Log StandardizationLogChaos: Challenges and Opportunities of Security Log Standardization
LogChaos: Challenges and Opportunities of Security Log Standardization
 
on log messages
on log messageson log messages
on log messages
 
MojoPortal And Log4net
MojoPortal And Log4netMojoPortal And Log4net
MojoPortal And Log4net
 
Six Mistakes of Log Management 2008
Six Mistakes of Log Management 2008Six Mistakes of Log Management 2008
Six Mistakes of Log Management 2008
 
The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012
 
From Monolith to Observable Microservices using DDD
From Monolith to Observable Microservices using DDDFrom Monolith to Observable Microservices using DDD
From Monolith to Observable Microservices using DDD
 
Technical Recruitment Overview & Tips
Technical Recruitment Overview & TipsTechnical Recruitment Overview & Tips
Technical Recruitment Overview & Tips
 
Oksana Safronova - Will you detect it or not? How to check if security team i...
Oksana Safronova - Will you detect it or not? How to check if security team i...Oksana Safronova - Will you detect it or not? How to check if security team i...
Oksana Safronova - Will you detect it or not? How to check if security team i...
 
Developer Fundamentals - Logging
Developer Fundamentals - LoggingDeveloper Fundamentals - Logging
Developer Fundamentals - Logging
 
How to Use OWASP Security Logging
How to Use OWASP Security LoggingHow to Use OWASP Security Logging
How to Use OWASP Security Logging
 
NIST 800-92 Log Management Guide in the Real World
NIST 800-92 Log Management Guide in the Real WorldNIST 800-92 Log Management Guide in the Real World
NIST 800-92 Log Management Guide in the Real World
 
Praesidio - Log.error("impossible-")
Praesidio - Log.error("impossible-")Praesidio - Log.error("impossible-")
Praesidio - Log.error("impossible-")
 
Tooling on distributed services
Tooling on distributed servicesTooling on distributed services
Tooling on distributed services
 
Making Logs Sexy Again: Can We Finally Lose The Regexes?
Making Logs Sexy Again: Can We Finally Lose The Regexes?Making Logs Sexy Again: Can We Finally Lose The Regexes?
Making Logs Sexy Again: Can We Finally Lose The Regexes?
 
Service worker API
Service worker APIService worker API
Service worker API
 
Security Practices - Logging.pptx
Security Practices - Logging.pptxSecurity Practices - Logging.pptx
Security Practices - Logging.pptx
 
Log Management Systems
Log Management SystemsLog Management Systems
Log Management Systems
 
TDC 2015 - POA - Trilha PHP - Shit Happens
TDC 2015 - POA - Trilha PHP - Shit HappensTDC 2015 - POA - Trilha PHP - Shit Happens
TDC 2015 - POA - Trilha PHP - Shit Happens
 
Shields up - improving web application security
Shields up - improving web application securityShields up - improving web application security
Shields up - improving web application security
 

Último

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Functional and non functional application logging

  • 1.
  • 3. About ME Sander De Vos Software Engineer RealDolmen 2008 Past projects MaTMa (M*) E-Metro (FOD-ECO) SP10B (FOD-FIN) MIK (FOD-MOB)
  • 4. QuotesFrom The Field “Whoneeds logs? Isuredon’t!” “Debugger is better! Sysoutworkstoo!” “Isn’tthatwhatinfrastructure does?” “It slows down disk and memory!” “It isn’t in the spec!” “We don’tknowwhatto log – we’lljust log something!” “We don’tknowhow – we’lljust do itsomehow!”
  • 5. Agenda What is logging Definition andChallenges Whylogging Whouses logs What logs are usedfor Functional or non-functional Whatto log Whatwill (not) help you Log messagedecomposed Guidelines How to log in Java Logging in production Log processing and analysis
  • 7. Definition “Logs are the recordings of one or more events occurring on information systems.” “Logs can be organized based on the program, day, severity, host, or a number of other categories.“ “Logs may be referred to as log files, audit logs, or audit trails. Logs also cover alerts, alarms and event records.“
  • 8. Log challenges Decentralization Cloud SOA Volatility Multiple tiersandlayers Archival Accessability Absence of critical information Random log formats
  • 10. Whouses logs Managed Services Security Teams Monitor Detect Investigate Track Analyze Auditors Developers Debugging Customer
  • 11. What logs are usedfor Debugging andForensics Fault monitoring Performance monitoring Troubleshooting Feature usage Security / Incident detection Regulatoryand standards compliance
  • 12. Functional – non-functionallogging Functional Audit Governance Security Non-functional Faults, Errors, Exceptions Execution context Performance Component usage
  • 13. Putting italltogether Functional Logs CustomerAudit Always on Requirements Scope known Years ‘Clutter, yuck, slow’ Non-Functional Logs System operatorDeveloper Sometimes on Errors, Exceptions, Debug Scope notknown Hours, Days ‘Mightcome in handy’
  • 15. Keep in mind ”Whatwouldhelp YOU at 3 AM in the morning? “ Image: Ambro / FreeDigitalPhotos.net
  • 16. Whatwillhelp you Exact notice of whathappened When Where How Who Clearconcise context information Analysis possible without application Manual Semi-automated Automated Remotelycollectible files Low footprint Proven reliableandauthentic
  • 17. Whatwill help youexamples 2011-05-31 08:46:11,308 +0200 INFO [eventlog.security] ACCESS OF ProfileServiceImpl.findProfilesBY [login: some_username]; Password: [PROTECTED]; Authenticated: true; Details: RemoteIpAddress: 192.168.156.17; SessionId: 8XyrNkLWv7FdXS… Granted Authorities:ROLE_USER,ROLE…
  • 18. Whatwon’thelp you No details about the record No context information Inconsistent format or bad use Non-correlatable Subjective/interpretativemessage Too muchuseless log records Loggingtoone single big file
  • 19. Whatwon’t help you – example#1 log4j: setFile called: ./logs/be/mobistar/network-status/log_functional.log, false log4j: setFileended tis nendefault tis nendefault Activations : 15 Deactivations : 0 In straigt to resource filter
  • 20. Whatwon’t help you – example#2 INFO [dao.ProductDao] [] - FOUND 40 INFO [web.listeners.PhaseLogger] [] - +RENDER_RESPONSE INFO [service.ProductFamilyService] [] - product in family is true INFO [.dao.ProfileDao] [] - [OBJECTS] find profiles
  • 22. “A log record shouldbeunderstandableby a human, andeasily machine processable.”
  • 23. LoggingGuidelines: Priorities Fatal Application crash&burn Error Exceptions Monitoring team alert Warn Monitor health, performance Info Informative Context Audit trail Debug Extensive Context Development, Testing Troubleshooting
  • 24. LoggingGuidelines: Exceptions Handling Recover Log the details ifcritical Not Handling, Translating Translate Handling logic ifnotpropagating Not Handling Propagate Someoneelsewill handle (and log!) Chooseexceptionsto log Defendfromstacktrace chaos Choosewhatto log foreachexception Catching block has all context details!
  • 25. LoggingGuidelines: Correlation 1 transaction = * log records Correlationnecessary Executiontrail Shared context variable Shared per transaction Reuse of context variables Nested Diagnostic Context Map Diagnostic Context Onlyonecorrelation Use a context uniquevariable Correlate transactions
  • 28. Java Logging Frameworks Implementation System.out – System.err Redirect output Java UtilLogging Log4j Logback Abstraction CommonsLogging SLF4J
  • 29. Java UtilLogging Java 1.4+ Based on Log4J Less features out of the box Console File Stream
  • 30. Log4j First framework Introductionof Logger, Appender, Level Hiearchical Loggers Configurableappenders, e.g. MailAppender FileAppender SMTPAppender SocketAppender SyslogAppender Leader quitandstartedlogback
  • 31. CommonsLogging Apache Project API Bridge API-calls forward to Log4j if on CP Falls back to JUL Plagued Double Configuration Runtime dependency check ClasspathScanning Discontinued v1.1.1 dates from end 2007
  • 32. Slf4j - Logback Twolibrariestorulethemall Slf4j Comparablewithcommons-logging Parameter parsing Framework bridges Much more powerful Logback Evolved log4j Implements Slf4j “Picking up where log4j leaves off” Testing Filters on-need-base
  • 35. Keepingit performant String concatenation LOGGER.debug("Hello " + name); Protected block if (logger.isDebugEnabled()) {LOGGER.debug("Hello " + name);} Slf4j LOGGER.debug("Hello {}", name);
  • 36. Context Variables In Practice NDC.push(correlationId); app.logMe("Hello world!"); NDC.pop(); Use %x in Pattern ConversionPattern= %x %d %m %n correlationId 2011-06-21 09:20:41 [INFO] Hello world!
  • 37. Specialized Loggers Logger for class Fine-tune log Executiontrace How distinguish Security Performance Business Specialized Loggers Priorities Output handlers Groupedlogging
  • 38. Logging In Production Onlynecessarylogging Situation -> turn on debuglogging No restart: DynamicReloading ‘Watch’ file for changes Log file management Rolling file Seperation of concerns Clustering Different systems generatemessages Synchronization of timestamps Correlation on host-specific files
  • 39. My Opinion Importance of loggingwillgrow Mobile / offline applications Cloud integration System interaction Logging standards enterprisewide Standardization of logging effort Inexpensiveexercise Draft a standard Build adapters / patterns Enforce standards
  • 40. Log Processing and analysis
  • 41. Log Analysis Bang foryourbuck XpoLog http://www.xpolog.com Licensed Faster Splunk http://www.splunk.com Free Edition ‘Slow’ AJAX feel Nice graphics Modular (http://www.splunkbase.com) Tuningyourpattern is important?
  • 42. Demo
  • 43.
  • 44. For more information: visit our website WWW.REALDOLMEN.COM Follow us on: Selected presentations are available on: Thank You Or scan this QR code with your Smartphone to immediately go to the website