SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere Àhnliche Inhalte

Was ist angesagt?

I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations WorkshopI Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations WorkshopApigee | Google Cloud
 
Sap testing tutorial
Sap testing tutorialSap testing tutorial
Sap testing tutorialGourav Dash
 
Enterprise Security Architecture for Cyber Security
Enterprise Security Architecture for Cyber SecurityEnterprise Security Architecture for Cyber Security
Enterprise Security Architecture for Cyber SecurityThe Open Group SA
 
IC-ISO-27001-Checklist-10838_PDF.pdf
IC-ISO-27001-Checklist-10838_PDF.pdfIC-ISO-27001-Checklist-10838_PDF.pdf
IC-ISO-27001-Checklist-10838_PDF.pdfNapoleon NV
 
Getting Creative with the Workday Request Framework
Getting Creative with the Workday Request FrameworkGetting Creative with the Workday Request Framework
Getting Creative with the Workday Request FrameworkWorkday, Inc.
 
DevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with DynatraceDevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with DynatraceAndreas Grabner
 
Backstage at CNCF Madison.pptx
Backstage at CNCF Madison.pptxBackstage at CNCF Madison.pptx
Backstage at CNCF Madison.pptxBrandenTimm1
 
Aligning to the NIST Cybersecurity Framework in the AWS
Aligning to the NIST Cybersecurity Framework in the AWSAligning to the NIST Cybersecurity Framework in the AWS
Aligning to the NIST Cybersecurity Framework in the AWSAmazon Web Services
 
Fiori for s4 hana troubleshooting tips and tricks
Fiori for s4 hana  troubleshooting tips and tricksFiori for s4 hana  troubleshooting tips and tricks
Fiori for s4 hana troubleshooting tips and tricksJasbir Khanuja
 
DevOps Services Offerings from Rational Lab Services
DevOps Services Offerings from Rational Lab ServicesDevOps Services Offerings from Rational Lab Services
DevOps Services Offerings from Rational Lab ServicesIBM Rational software
 
Apache Kafka in the Telco Industry (OSS, BSS, OTT, IMS, NFV, Middleware, Main...
Apache Kafka in the Telco Industry (OSS, BSS, OTT, IMS, NFV, Middleware, Main...Apache Kafka in the Telco Industry (OSS, BSS, OTT, IMS, NFV, Middleware, Main...
Apache Kafka in the Telco Industry (OSS, BSS, OTT, IMS, NFV, Middleware, Main...Kai WĂ€hner
 
Security Incident Log Review Checklist by Dr Anton Chuvakin and Lenny Zeltser
Security Incident Log Review Checklist by Dr Anton Chuvakin and Lenny ZeltserSecurity Incident Log Review Checklist by Dr Anton Chuvakin and Lenny Zeltser
Security Incident Log Review Checklist by Dr Anton Chuvakin and Lenny ZeltserAnton Chuvakin
 
Microservices Architecture for e-Commerce
Microservices Architecture for e-CommerceMicroservices Architecture for e-Commerce
Microservices Architecture for e-CommerceDivante
 
Secure your Access to Cloud Apps using Microsoft Defender for Cloud Apps
Secure your Access to Cloud Apps using Microsoft Defender for Cloud AppsSecure your Access to Cloud Apps using Microsoft Defender for Cloud Apps
Secure your Access to Cloud Apps using Microsoft Defender for Cloud AppsVignesh Ganesan I Microsoft MVP
 
Platform Engineering
Platform EngineeringPlatform Engineering
Platform EngineeringOpsta
 
Getting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeGetting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeWinWire Technologies Inc
 
Sap S/4 HANA New Implementation
Sap S/4 HANA New ImplementationSap S/4 HANA New Implementation
Sap S/4 HANA New ImplementationSoumya De
 
Domain Driven Design, Event Storming and Event Driven Applications
Domain Driven Design, Event Storming and Event Driven ApplicationsDomain Driven Design, Event Storming and Event Driven Applications
Domain Driven Design, Event Storming and Event Driven ApplicationsJeremy Davis
 
Structured Approach to Solution Architecture
Structured Approach to Solution ArchitectureStructured Approach to Solution Architecture
Structured Approach to Solution ArchitectureAlan McSweeney
 

Was ist angesagt? (20)

I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations WorkshopI Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
 
Sap testing tutorial
Sap testing tutorialSap testing tutorial
Sap testing tutorial
 
Enterprise Security Architecture for Cyber Security
Enterprise Security Architecture for Cyber SecurityEnterprise Security Architecture for Cyber Security
Enterprise Security Architecture for Cyber Security
 
IC-ISO-27001-Checklist-10838_PDF.pdf
IC-ISO-27001-Checklist-10838_PDF.pdfIC-ISO-27001-Checklist-10838_PDF.pdf
IC-ISO-27001-Checklist-10838_PDF.pdf
 
Getting Creative with the Workday Request Framework
Getting Creative with the Workday Request FrameworkGetting Creative with the Workday Request Framework
Getting Creative with the Workday Request Framework
 
DevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with DynatraceDevOps Transformation at Dynatrace and with Dynatrace
DevOps Transformation at Dynatrace and with Dynatrace
 
Backstage at CNCF Madison.pptx
Backstage at CNCF Madison.pptxBackstage at CNCF Madison.pptx
Backstage at CNCF Madison.pptx
 
Aligning to the NIST Cybersecurity Framework in the AWS
Aligning to the NIST Cybersecurity Framework in the AWSAligning to the NIST Cybersecurity Framework in the AWS
Aligning to the NIST Cybersecurity Framework in the AWS
 
Fiori for s4 hana troubleshooting tips and tricks
Fiori for s4 hana  troubleshooting tips and tricksFiori for s4 hana  troubleshooting tips and tricks
Fiori for s4 hana troubleshooting tips and tricks
 
DevOps Services Offerings from Rational Lab Services
DevOps Services Offerings from Rational Lab ServicesDevOps Services Offerings from Rational Lab Services
DevOps Services Offerings from Rational Lab Services
 
Apache Kafka in the Telco Industry (OSS, BSS, OTT, IMS, NFV, Middleware, Main...
Apache Kafka in the Telco Industry (OSS, BSS, OTT, IMS, NFV, Middleware, Main...Apache Kafka in the Telco Industry (OSS, BSS, OTT, IMS, NFV, Middleware, Main...
Apache Kafka in the Telco Industry (OSS, BSS, OTT, IMS, NFV, Middleware, Main...
 
Security Incident Log Review Checklist by Dr Anton Chuvakin and Lenny Zeltser
Security Incident Log Review Checklist by Dr Anton Chuvakin and Lenny ZeltserSecurity Incident Log Review Checklist by Dr Anton Chuvakin and Lenny Zeltser
Security Incident Log Review Checklist by Dr Anton Chuvakin and Lenny Zeltser
 
Microservices Architecture for e-Commerce
Microservices Architecture for e-CommerceMicroservices Architecture for e-Commerce
Microservices Architecture for e-Commerce
 
Secure your Access to Cloud Apps using Microsoft Defender for Cloud Apps
Secure your Access to Cloud Apps using Microsoft Defender for Cloud AppsSecure your Access to Cloud Apps using Microsoft Defender for Cloud Apps
Secure your Access to Cloud Apps using Microsoft Defender for Cloud Apps
 
Platform Engineering
Platform EngineeringPlatform Engineering
Platform Engineering
 
Getting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeGetting Started with Infrastructure as Code
Getting Started with Infrastructure as Code
 
Sap S/4 HANA New Implementation
Sap S/4 HANA New ImplementationSap S/4 HANA New Implementation
Sap S/4 HANA New Implementation
 
Azure Pipelines
Azure PipelinesAzure Pipelines
Azure Pipelines
 
Domain Driven Design, Event Storming and Event Driven Applications
Domain Driven Design, Event Storming and Event Driven ApplicationsDomain Driven Design, Event Storming and Event Driven Applications
Domain Driven Design, Event Storming and Event Driven Applications
 
Structured Approach to Solution Architecture
Structured Approach to Solution ArchitectureStructured Approach to Solution Architecture
Structured Approach to Solution Architecture
 

Andere mochten auch

Spring Reference
Spring ReferenceSpring Reference
Spring ReferenceSyed Shahul
 
Java logging
Java loggingJava logging
Java loggingJumping Bean
 
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
 

Andere mochten auch (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
 

Ähnlich wie Functional and non functional application logging

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
 
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
 
on log messages
on log messageson log messages
on log messagesLaurence Chen
 
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
 
Service worker API
Service worker APIService worker API
Service worker APIGiorgio Natili
 
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
 

Ähnlich wie Functional and non functional application logging (20)

Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?Application Logging Good Bad Ugly ... Beautiful?
Application Logging Good Bad Ugly ... Beautiful?
 
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
 

KĂŒrzlich hochgeladen

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
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
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 

KĂŒrzlich hochgeladen (20)

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
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)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
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
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.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