Connect the Dots: Logging and Exception Handling
April 27, 2019
Bangalore MuleSoft Meetup Group
Agenda
2
09:30PM – 10:00AM – Introductions
10:00PM - 12:00PM – Common Exception Handling & Common Logging
12:00PM - 12:30PM – Q&A
12:30PM - 12:45PM – Open Floor, Suggestions for Future Topics and Speakers
12:45PM - 01:30PM – Lunch
Agenda
Introductions
About the organizer :
– Gaurav – Senior Application Developer, Accenture
– D. Rajesh Kumar – Senior Technology Architect , TCS
Partner:
All contents © MuleSoft Inc.
All contents © MuleSoft Inc.
Introductions
5
Introduce yourselves !
– Name
– Background
• What’s your experience with Anypoint platform?
• Why are you here ? Expectations?
Common Logging and Exception
For any integration, In order to facilitate service request tracking and incident
management it is required to have an effective logging and exception handling solution.
Within in MULESOFT, various components involved based on various deployment
patterns..
Standard logger
JSON logger
Cloud hub logger and supporting tools like.. Alerting, monitoring and email
notifications..
End of the day , its essential to have some log aggregation tools.. For example Splunk,
ELK and service incident management tool like SNOW, Remedy force..
Common Logging and Exception
Best practices recommended:
• Categorize the logs: Traceable, audit, exception logs..
• Separate the flows to for exception logs with logic (for example: business exceptions, data
validations, technical issues..)
• Have standard CDM format for logs based on the category and follows same for all the
integrations
• Handle exceptions and logs in the common project and have integration logic with in the
common project.
• Usage of correlation id / message id / business transaction id
• Define log related flows are Async
• Possible use MQ to avoid data loss and data consistency
• Logging steps @critical places
Mule 4 Logging
• The importance of logging
• Logging bad practice
• Best practices with logging
• Log4j 2
• Logging to different target systems
• Common Exception Handling
More Than Logging
9
• System visibility
• System traceability
• Supportability
• Debugging
Log In First Place
10
• No logging standards
• Hard coding
• Empty loggers
• Beware: CloudHub logs are limited by size
• 100MB or 30 days, whichever comes first
Bad Practice
Demo
Logging Bad Practice
12
• Standards, standards, standards
• JSON
• Key-value pairs
• Other formats
• Informative messages
• Visibility into the system
• Enhance debugging
• Before and after external system calls
• Request identifier
• Trace transaction from end to end
• Ability to calculate latency
Best Practices
13
• Dynamic error messages
• Persisting logs to a system
• Maintain historical logs
• Allows non-technical users to access and
support applications
• Not too much logging, not too little
Best Practices
LOG : (prefix :string, value :any)
Returns the specified value and also logs the value in the DataWeave representation with the specified
prefix.
Transform :
%dw 2.0
output application/json
var data={
"week" : ["Sunday","Monday"]
}
---
{
isPresent : log("logging in the array", data.week contains vars.lookup)
}
Console :
logging in the array - true
DataWeave Logging
Demo
Logging Best Practices
Demo
Common Exception Handling
All contents © MuleSoft Inc.
Quiz
15
Winners will receive a gift
What are the 5 different logging levels that the standard
MuleSoft Logger Component uses?
Giveaway!
Learn all about Mule 4 and more!
Resources to learn
All contents © MuleSoft Inc.
MuleSoft U
20
• Free!
• Self-paced HTML-format courses with step-by-step instructions to go
deep on any topic.
• Available courses:
- NEW - Development fundamentals (Mule 3 and 4)
- NEW – Mule 4 for Mule 3 users
- Flow Design
- Getting started with Anypoint Platform (Mule 3 and 4)
Register for MuleSoft U at
https://training.mulesoft.com/category/mulesoftu
All contents © MuleSoft Inc.
Instructor-led training
21
• 1 to 5 days, in person or online
• 12 available courses
• For all profiles: developers, architects, admins, IT ops, managers
See all the learning paths available and register for a class at
https://training.mulesoft.com
Win 1 of 5 free instructor-led training courses by participating in our
trivia later tonight!
All contents © MuleSoft Inc.
More certifications to validate your skills
22
• Confirm mastery of concepts
• Achieve industry recognition
• Differentiate yourself in the marketplace
– MCD – Level 1 (Mule 4) + Level 1 (Mule 4) DELTA
– MCD – Integration and API Associate
– MCD – API Design Associate
– MCD – Integration Professional (Mule 3)
– MuleSoft Certified Platform Architect – Level 1
– MuleSoft Certified Integration Architect – Level 1
QA & open discussion
All contents © MuleSoft Inc.
Stay connected
24
Stay connected with Mule 4
Twitter: https:// twitter.com/Mulesoft
Linkedin: https://www.linkedin.com/groups/6936034 /
Facebook: https ://www.facebook.com/groups/Mulesoft/
Thank you !
See you next time
Please send topic suggestions to the organizer

mulesoft meetup @ bangalore

  • 1.
    Connect the Dots:Logging and Exception Handling April 27, 2019 Bangalore MuleSoft Meetup Group
  • 2.
    Agenda 2 09:30PM – 10:00AM– Introductions 10:00PM - 12:00PM – Common Exception Handling & Common Logging 12:00PM - 12:30PM – Q&A 12:30PM - 12:45PM – Open Floor, Suggestions for Future Topics and Speakers 12:45PM - 01:30PM – Lunch Agenda
  • 3.
    Introductions About the organizer: – Gaurav – Senior Application Developer, Accenture – D. Rajesh Kumar – Senior Technology Architect , TCS Partner: All contents © MuleSoft Inc.
  • 4.
    All contents ©MuleSoft Inc. Introductions 5 Introduce yourselves ! – Name – Background • What’s your experience with Anypoint platform? • Why are you here ? Expectations?
  • 5.
    Common Logging andException For any integration, In order to facilitate service request tracking and incident management it is required to have an effective logging and exception handling solution. Within in MULESOFT, various components involved based on various deployment patterns.. Standard logger JSON logger Cloud hub logger and supporting tools like.. Alerting, monitoring and email notifications.. End of the day , its essential to have some log aggregation tools.. For example Splunk, ELK and service incident management tool like SNOW, Remedy force..
  • 6.
    Common Logging andException Best practices recommended: • Categorize the logs: Traceable, audit, exception logs.. • Separate the flows to for exception logs with logic (for example: business exceptions, data validations, technical issues..) • Have standard CDM format for logs based on the category and follows same for all the integrations • Handle exceptions and logs in the common project and have integration logic with in the common project. • Usage of correlation id / message id / business transaction id • Define log related flows are Async • Possible use MQ to avoid data loss and data consistency • Logging steps @critical places
  • 7.
  • 8.
    • The importanceof logging • Logging bad practice • Best practices with logging • Log4j 2 • Logging to different target systems • Common Exception Handling More Than Logging
  • 9.
    9 • System visibility •System traceability • Supportability • Debugging Log In First Place
  • 10.
    10 • No loggingstandards • Hard coding • Empty loggers • Beware: CloudHub logs are limited by size • 100MB or 30 days, whichever comes first Bad Practice
  • 11.
  • 12.
    12 • Standards, standards,standards • JSON • Key-value pairs • Other formats • Informative messages • Visibility into the system • Enhance debugging • Before and after external system calls • Request identifier • Trace transaction from end to end • Ability to calculate latency Best Practices
  • 13.
    13 • Dynamic errormessages • Persisting logs to a system • Maintain historical logs • Allows non-technical users to access and support applications • Not too much logging, not too little Best Practices
  • 14.
    LOG : (prefix:string, value :any) Returns the specified value and also logs the value in the DataWeave representation with the specified prefix. Transform : %dw 2.0 output application/json var data={ "week" : ["Sunday","Monday"] } --- { isPresent : log("logging in the array", data.week contains vars.lookup) } Console : logging in the array - true DataWeave Logging
  • 15.
  • 16.
  • 17.
    All contents ©MuleSoft Inc. Quiz 15 Winners will receive a gift
  • 18.
    What are the5 different logging levels that the standard MuleSoft Logger Component uses? Giveaway!
  • 19.
    Learn all aboutMule 4 and more! Resources to learn
  • 20.
    All contents ©MuleSoft Inc. MuleSoft U 20 • Free! • Self-paced HTML-format courses with step-by-step instructions to go deep on any topic. • Available courses: - NEW - Development fundamentals (Mule 3 and 4) - NEW – Mule 4 for Mule 3 users - Flow Design - Getting started with Anypoint Platform (Mule 3 and 4) Register for MuleSoft U at https://training.mulesoft.com/category/mulesoftu
  • 21.
    All contents ©MuleSoft Inc. Instructor-led training 21 • 1 to 5 days, in person or online • 12 available courses • For all profiles: developers, architects, admins, IT ops, managers See all the learning paths available and register for a class at https://training.mulesoft.com Win 1 of 5 free instructor-led training courses by participating in our trivia later tonight!
  • 22.
    All contents ©MuleSoft Inc. More certifications to validate your skills 22 • Confirm mastery of concepts • Achieve industry recognition • Differentiate yourself in the marketplace – MCD – Level 1 (Mule 4) + Level 1 (Mule 4) DELTA – MCD – Integration and API Associate – MCD – API Design Associate – MCD – Integration Professional (Mule 3) – MuleSoft Certified Platform Architect – Level 1 – MuleSoft Certified Integration Architect – Level 1
  • 23.
    QA & opendiscussion
  • 24.
    All contents ©MuleSoft Inc. Stay connected 24 Stay connected with Mule 4 Twitter: https:// twitter.com/Mulesoft Linkedin: https://www.linkedin.com/groups/6936034 / Facebook: https ://www.facebook.com/groups/Mulesoft/
  • 25.
    Thank you ! Seeyou next time Please send topic suggestions to the organizer