SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

What's hot (20)

Swagger With REST APIs.pptx.pdf
Swagger With REST APIs.pptx.pdfSwagger With REST APIs.pptx.pdf
Swagger With REST APIs.pptx.pdf
 
Building Azure Logic Apps
Building Azure Logic AppsBuilding Azure Logic Apps
Building Azure Logic Apps
 
Hexagonal architecture for java applications
Hexagonal architecture for java applicationsHexagonal architecture for java applications
Hexagonal architecture for java applications
 
The tests are trying to tell you something@VoxxedBucharest.pptx
The tests are trying to tell you something@VoxxedBucharest.pptxThe tests are trying to tell you something@VoxxedBucharest.pptx
The tests are trying to tell you something@VoxxedBucharest.pptx
 
Clean Code @Voxxed Days Cluj 2023 - opening Keynote
Clean Code @Voxxed Days Cluj 2023 - opening KeynoteClean Code @Voxxed Days Cluj 2023 - opening Keynote
Clean Code @Voxxed Days Cluj 2023 - opening Keynote
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
[WSO2 API Manager Community Call] Mastering JWTs with WSO2 API Manager
[WSO2 API Manager Community Call] Mastering JWTs with WSO2 API Manager[WSO2 API Manager Community Call] Mastering JWTs with WSO2 API Manager
[WSO2 API Manager Community Call] Mastering JWTs with WSO2 API Manager
 
2012 the clean architecture by Uncle bob
2012 the clean architecture by Uncle bob 2012 the clean architecture by Uncle bob
2012 the clean architecture by Uncle bob
 
Microservices
MicroservicesMicroservices
Microservices
 
Hexagonal Architecture
Hexagonal ArchitectureHexagonal Architecture
Hexagonal Architecture
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
CQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility SegregationCQRS: Command/Query Responsibility Segregation
CQRS: Command/Query Responsibility Segregation
 
Microsoft power virtual agents
Microsoft power virtual agentsMicrosoft power virtual agents
Microsoft power virtual agents
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Integration testing with spring @snow one
Integration testing with spring @snow oneIntegration testing with spring @snow one
Integration testing with spring @snow one
 
Hexagonal Architecture.pdf
Hexagonal Architecture.pdfHexagonal Architecture.pdf
Hexagonal Architecture.pdf
 
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
Anatomy of a Spring Boot App with Clean Architecture - Spring I/O 2023
 
The Secrets of Hexagonal Architecture
The Secrets of Hexagonal ArchitectureThe Secrets of Hexagonal Architecture
The Secrets of Hexagonal Architecture
 
API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...API Integration For Building Software Applications Powerpoint Presentation Sl...
API Integration For Building Software Applications Powerpoint Presentation Sl...
 
Microservices
MicroservicesMicroservices
Microservices
 

Viewers also liked

Spring Reference
Spring ReferenceSpring Reference
Spring Reference
Syed Shahul
 

Viewers also liked (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 to Functional and non functional application logging

The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012The importance of logs - DefCamp 2012
The importance of logs - DefCamp 2012
DefCamp
 
Developer Fundamentals - Logging
Developer Fundamentals - LoggingDeveloper Fundamentals - Logging
Developer Fundamentals - Logging
Axel Irriger
 

Similar to 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
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

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