SlideShare a Scribd company logo
LOGGING BEST PRACTICE
IN MULE
USING
LOGGER COMPONENT
Govind Mulinti
2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential
• Logging is been a key discussion whenever we go back
to an application for analysis or debugging. Having
proper logs in the application is first best practice that
we need to put into practice. The next thought should
be given to how these logs would be useful to the
supporting team members.
• Here we discuss a few best practices that we can
make use while creating the ESB applications which
will be very useful and appreciated by the support
team or whoever is looking at the application at a
later point in time.
2
Logging Best Practice in Mule ESB using Logger component
2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential
Log4j configuration
First rule of thumb, we will be using log4j.properties file with in the
application/mule project that we wish to configure for appropriate logging. We
would configure the log4j to use the RollingFileAppender as below.
# Default log level
log4j.rootCategory=WARN, file
log4j.appender.file = org.apache.log4j.RollingFileAppender
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.File = ${mule.home}/logs/mule-app-myproject.log
log4j.appender.file.Append = true
log4j.appender.file.layout = org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-5p %d [%t] %c: %m%n
3
2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential
Using logger component
We can see that the default log level is set to WARN. This will enable us to
log the application related logs at INFO or DEBUG levels.
Now in the project go ahead and add the logger component. The properties
for one of the logger that I have used is shown below.
You are free to set the name and the message as per the naming and
messaging best practices. We are more interested now are in the ‘Level’ and
the ‘Category’ fields.
4
2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential
Using the Log Level
• For ‘Level’ property, we suggest for all the custom messages should be set to
DEBUG level. Few log messages, which we wish to highlight or want them to be
available of at a higher level like an entry and exit of the flows, calls or some
specific functionality, can be set to INFO.
• The ‘Category’ property should be set to string similar to a package of a java
class.
• For example here we are using ‘com.ww.myproject.myfunction.flow2’.
• We should follow a practice so anyone using this can decode this string. Here I
have a base package of ‘com.ww’ which would be for an organization. Then the
project name, which is ‘myproject’ and then the flow name in that particular
project.
• So we can decode my package of which would be for the logger from the flow
named ‘flow2’ within an application denoted by name or known as ‘myproject’.
The additional element ‘myfunction’ is added which tells us that this flow is part
of that functionality that is implemented.
5
2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential
Setting Log Level in log4j.properties
Now, that is good for our understanding. We will see how this can be used with in the log4j.properties.
We have seen that I have set the default log level to ‘WARN’. SO now if I wish to see the logs for my
application ‘myproject’ then I would add the following line in the log4j.properties file.
log4j.logger.com.ww.project=DEBUG
This would generate all the debug messages related to the project. This may generate a huge set of logs, so
you may want to get only the logs specific to the functionality that you are currently looking into. So that is
where this functionality element that we added into our package comes into play. To obtain this we would
update the parameters as shown below.
log4j.logger.com.ww.myproject.myfunction=DEBUG
Further to drill down you can enable or disable the logs specific to those flow to get more granular set of
messages as shown below for flow2. We can add multiple similar lines for each flow if we need such small
sets of logs for specific flows and avoid rest of the log messages.
log4j.logger.com.ww.myproject.myfunction.flow2=DEBUG
6
2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential
Conclusion
After debugging process this line should be either
commented or removed from the log4j.properties file so we
stop producing the huge set of logs file containing detailed
debug messages.
By putting this into practice we can ensure that the
customers as well as the support team would appreciate the
efforts put into this. This would help the support team to
look into the logs and get debug messages so as to analyze
the issue that are investigated. This would reduce the
investigation time, to narrow down to the root cause and to
provide appropriate fix with a short turnaround time.
7

More Related Content

What's hot

Error Handling in Mulesoft
Error Handling in MulesoftError Handling in Mulesoft
Error Handling in Mulesoft
Amit Singh
 
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Anoop Ramachandran
 
Best Practices for API Security
Best Practices for API SecurityBest Practices for API Security
Best Practices for API Security
MuleSoft
 
A comprehensive guide to mule soft mule 4
A comprehensive guide to mule soft mule 4A comprehensive guide to mule soft mule 4
A comprehensive guide to mule soft mule 4
pruthviraj krishnam
 
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
Jitendra Bafna
 
MuleSoft Architecture Presentation
MuleSoft Architecture PresentationMuleSoft Architecture Presentation
MuleSoft Architecture Presentation
Rupesh Sinha
 
Mule Common Logging & Error Handling Framework
Mule Common Logging & Error Handling FrameworkMule Common Logging & Error Handling Framework
Mule Common Logging & Error Handling Framework
Vijay Reddy
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0
NeerajKumar1965
 
Anypoint platform architecture and components
Anypoint platform architecture and componentsAnypoint platform architecture and components
Anypoint platform architecture and components
D.Rajesh Kumar
 
Microservices on Anypoint Platform
Microservices on Anypoint PlatformMicroservices on Anypoint Platform
Microservices on Anypoint Platform
MuleSoft
 
Managing APIs with MuleSoft
Managing APIs with MuleSoftManaging APIs with MuleSoft
Managing APIs with MuleSoft
Guilherme Pereira Silva
 
Cloudhub 2.0
Cloudhub 2.0Cloudhub 2.0
Cloudhub 2.0
Christopher Co
 
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECTFlow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Sabrina Marechal
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
Kellton Tech Solutions Ltd
 
Learn More About Object Store | MuleSoft Mysore Meetup #9
Learn More About Object Store | MuleSoft Mysore Meetup #9Learn More About Object Store | MuleSoft Mysore Meetup #9
Learn More About Object Store | MuleSoft Mysore Meetup #9
MysoreMuleSoftMeetup
 
10 things to consider when planning your Mule 4 migration
10 things to consider when planning your Mule 4 migration10 things to consider when planning your Mule 4 migration
10 things to consider when planning your Mule 4 migration
Coforge (Erstwhile WHISHWORKS)
 
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Eva Mave Ng
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
Alexandra N. Martinez
 
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
Jitendra Bafna
 
SAP Integration with MuleSoft | MuleSoft Mysore Meetup #14
SAP Integration with MuleSoft | MuleSoft Mysore Meetup #14 SAP Integration with MuleSoft | MuleSoft Mysore Meetup #14
SAP Integration with MuleSoft | MuleSoft Mysore Meetup #14
MysoreMuleSoftMeetup
 

What's hot (20)

Error Handling in Mulesoft
Error Handling in MulesoftError Handling in Mulesoft
Error Handling in Mulesoft
 
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
Introduction to Anypoint Runtime Fabric on Amazon Elastic Kubernetes Service ...
 
Best Practices for API Security
Best Practices for API SecurityBest Practices for API Security
Best Practices for API Security
 
A comprehensive guide to mule soft mule 4
A comprehensive guide to mule soft mule 4A comprehensive guide to mule soft mule 4
A comprehensive guide to mule soft mule 4
 
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
MuleSoft Surat Meetup#41 - Universal API Management, Anypoint Flex Gateway an...
 
MuleSoft Architecture Presentation
MuleSoft Architecture PresentationMuleSoft Architecture Presentation
MuleSoft Architecture Presentation
 
Mule Common Logging & Error Handling Framework
Mule Common Logging & Error Handling FrameworkMule Common Logging & Error Handling Framework
Mule Common Logging & Error Handling Framework
 
Introduction to CloudHub 2.0
Introduction to CloudHub 2.0Introduction to CloudHub 2.0
Introduction to CloudHub 2.0
 
Anypoint platform architecture and components
Anypoint platform architecture and componentsAnypoint platform architecture and components
Anypoint platform architecture and components
 
Microservices on Anypoint Platform
Microservices on Anypoint PlatformMicroservices on Anypoint Platform
Microservices on Anypoint Platform
 
Managing APIs with MuleSoft
Managing APIs with MuleSoftManaging APIs with MuleSoft
Managing APIs with MuleSoft
 
Cloudhub 2.0
Cloudhub 2.0Cloudhub 2.0
Cloudhub 2.0
 
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECTFlow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
 
Learn More About Object Store | MuleSoft Mysore Meetup #9
Learn More About Object Store | MuleSoft Mysore Meetup #9Learn More About Object Store | MuleSoft Mysore Meetup #9
Learn More About Object Store | MuleSoft Mysore Meetup #9
 
10 things to consider when planning your Mule 4 migration
10 things to consider when planning your Mule 4 migration10 things to consider when planning your Mule 4 migration
10 things to consider when planning your Mule 4 migration
 
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
 
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
MuleSoft Surat Virtual Meetup#21 - MuleSoft API and RAML Design Best Practice...
 
SAP Integration with MuleSoft | MuleSoft Mysore Meetup #14
SAP Integration with MuleSoft | MuleSoft Mysore Meetup #14 SAP Integration with MuleSoft | MuleSoft Mysore Meetup #14
SAP Integration with MuleSoft | MuleSoft Mysore Meetup #14
 

Viewers also liked

Clustering of Mule ESB
Clustering of Mule ESBClustering of Mule ESB
Clustering of Mule ESB
Sreekanth Kondapalli
 
Mule - logger
Mule -  loggerMule -  logger
Mule - logger
Ankush Sharma
 
Logger
LoggerLogger
Logger
krishashi
 
Logging configuration in mule
Logging configuration in muleLogging configuration in mule
Logging configuration in mule
Son Nguyen
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with mule
Govind Mulinti
 
Canonical data model
Canonical data modelCanonical data model
Canonical data model
Govind Mulinti
 
Configuring log4j2
Configuring log4j2Configuring log4j2
Configuring log4j2
Anirban Sen Chowdhary
 
Logger
LoggerLogger
Mule message structure
Mule message structureMule message structure
Mule message structure
Srilatha Kante
 
Mule debugging logging_in_mule
Mule debugging logging_in_muleMule debugging logging_in_mule
Mule debugging logging_in_mule
kunal vishe
 

Viewers also liked (10)

Clustering of Mule ESB
Clustering of Mule ESBClustering of Mule ESB
Clustering of Mule ESB
 
Mule - logger
Mule -  loggerMule -  logger
Mule - logger
 
Logger
LoggerLogger
Logger
 
Logging configuration in mule
Logging configuration in muleLogging configuration in mule
Logging configuration in mule
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with mule
 
Canonical data model
Canonical data modelCanonical data model
Canonical data model
 
Configuring log4j2
Configuring log4j2Configuring log4j2
Configuring log4j2
 
Logger
LoggerLogger
Logger
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Mule debugging logging_in_mule
Mule debugging logging_in_muleMule debugging logging_in_mule
Mule debugging logging_in_mule
 

Similar to Logging best practice in mule using logger component

AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
NITSAN Technologies Pvt Ltd
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Alessandro Molina
 
Slides123.pdf
Slides123.pdfSlides123.pdf
Slides123.pdf
RECTunisia
 
Manual 5
Manual 5Manual 5
Manual 5
arifhossen
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based development
go_oh
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Mack Hardy
 
revolutionizing-development-a-deep-dive-into-angular-v17-renaissance.pdf
revolutionizing-development-a-deep-dive-into-angular-v17-renaissance.pdfrevolutionizing-development-a-deep-dive-into-angular-v17-renaissance.pdf
revolutionizing-development-a-deep-dive-into-angular-v17-renaissance.pdf
RobertThorson2
 
Serverless Solutions for developers
Serverless Solutions for developersServerless Solutions for developers
Serverless Solutions for developers
Juan Pablo
 
Open ERP's Community Organisation
Open ERP's Community OrganisationOpen ERP's Community Organisation
Open ERP's Community Organisation
Fabien Pinckaers
 
SAP_Enable_Now_Master_Guide_en-US.pdf
SAP_Enable_Now_Master_Guide_en-US.pdfSAP_Enable_Now_Master_Guide_en-US.pdf
SAP_Enable_Now_Master_Guide_en-US.pdf
ssuser2e8ccd
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
kesavan N B
 
LOG4J VULNERABILITY SAP BUSINESS ONE IMPACT AND WORK AROUNDS
LOG4J VULNERABILITY SAP BUSINESS ONE IMPACT AND WORK AROUNDSLOG4J VULNERABILITY SAP BUSINESS ONE IMPACT AND WORK AROUNDS
LOG4J VULNERABILITY SAP BUSINESS ONE IMPACT AND WORK AROUNDS
AGSanePLDTCompany
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
OlinData
 
Svn tutorial
Svn tutorialSvn tutorial
Svn tutorial
kalyansiri
 
Svn tutorial
Svn tutorialSvn tutorial
Svn tutorial
Priyabrata Sahu
 
TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013
die.agilen GmbH
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development
Robin O'Brien
 
ALPHA Script - Presentation
ALPHA Script - PresentationALPHA Script - Presentation
ALPHA Script - PresentationPROBOTEK
 

Similar to Logging best practice in mule using logger component (20)

AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
 
Slides123.pdf
Slides123.pdfSlides123.pdf
Slides123.pdf
 
Manual 5
Manual 5Manual 5
Manual 5
 
Cakephp manual-11
Cakephp manual-11Cakephp manual-11
Cakephp manual-11
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based development
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
revolutionizing-development-a-deep-dive-into-angular-v17-renaissance.pdf
revolutionizing-development-a-deep-dive-into-angular-v17-renaissance.pdfrevolutionizing-development-a-deep-dive-into-angular-v17-renaissance.pdf
revolutionizing-development-a-deep-dive-into-angular-v17-renaissance.pdf
 
Serverless Solutions for developers
Serverless Solutions for developersServerless Solutions for developers
Serverless Solutions for developers
 
Logback
LogbackLogback
Logback
 
Open ERP's Community Organisation
Open ERP's Community OrganisationOpen ERP's Community Organisation
Open ERP's Community Organisation
 
SAP_Enable_Now_Master_Guide_en-US.pdf
SAP_Enable_Now_Master_Guide_en-US.pdfSAP_Enable_Now_Master_Guide_en-US.pdf
SAP_Enable_Now_Master_Guide_en-US.pdf
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 
LOG4J VULNERABILITY SAP BUSINESS ONE IMPACT AND WORK AROUNDS
LOG4J VULNERABILITY SAP BUSINESS ONE IMPACT AND WORK AROUNDSLOG4J VULNERABILITY SAP BUSINESS ONE IMPACT AND WORK AROUNDS
LOG4J VULNERABILITY SAP BUSINESS ONE IMPACT AND WORK AROUNDS
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Svn tutorial
Svn tutorialSvn tutorial
Svn tutorial
 
Svn tutorial
Svn tutorialSvn tutorial
Svn tutorial
 
TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013TYPO3 Flow 2.0 in the field - webtech Conference 2013
TYPO3 Flow 2.0 in the field - webtech Conference 2013
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development
 
ALPHA Script - Presentation
ALPHA Script - PresentationALPHA Script - Presentation
ALPHA Script - Presentation
 

Recently uploaded

OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 

Recently uploaded (20)

OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 

Logging best practice in mule using logger component

  • 1. LOGGING BEST PRACTICE IN MULE USING LOGGER COMPONENT Govind Mulinti
  • 2. 2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential • Logging is been a key discussion whenever we go back to an application for analysis or debugging. Having proper logs in the application is first best practice that we need to put into practice. The next thought should be given to how these logs would be useful to the supporting team members. • Here we discuss a few best practices that we can make use while creating the ESB applications which will be very useful and appreciated by the support team or whoever is looking at the application at a later point in time. 2 Logging Best Practice in Mule ESB using Logger component
  • 3. 2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential Log4j configuration First rule of thumb, we will be using log4j.properties file with in the application/mule project that we wish to configure for appropriate logging. We would configure the log4j to use the RollingFileAppender as below. # Default log level log4j.rootCategory=WARN, file log4j.appender.file = org.apache.log4j.RollingFileAppender log4j.appender.file.MaxFileSize=1MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.File = ${mule.home}/logs/mule-app-myproject.log log4j.appender.file.Append = true log4j.appender.file.layout = org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%-5p %d [%t] %c: %m%n 3
  • 4. 2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential Using logger component We can see that the default log level is set to WARN. This will enable us to log the application related logs at INFO or DEBUG levels. Now in the project go ahead and add the logger component. The properties for one of the logger that I have used is shown below. You are free to set the name and the message as per the naming and messaging best practices. We are more interested now are in the ‘Level’ and the ‘Category’ fields. 4
  • 5. 2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential Using the Log Level • For ‘Level’ property, we suggest for all the custom messages should be set to DEBUG level. Few log messages, which we wish to highlight or want them to be available of at a higher level like an entry and exit of the flows, calls or some specific functionality, can be set to INFO. • The ‘Category’ property should be set to string similar to a package of a java class. • For example here we are using ‘com.ww.myproject.myfunction.flow2’. • We should follow a practice so anyone using this can decode this string. Here I have a base package of ‘com.ww’ which would be for an organization. Then the project name, which is ‘myproject’ and then the flow name in that particular project. • So we can decode my package of which would be for the logger from the flow named ‘flow2’ within an application denoted by name or known as ‘myproject’. The additional element ‘myfunction’ is added which tells us that this flow is part of that functionality that is implemented. 5
  • 6. 2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential Setting Log Level in log4j.properties Now, that is good for our understanding. We will see how this can be used with in the log4j.properties. We have seen that I have set the default log level to ‘WARN’. SO now if I wish to see the logs for my application ‘myproject’ then I would add the following line in the log4j.properties file. log4j.logger.com.ww.project=DEBUG This would generate all the debug messages related to the project. This may generate a huge set of logs, so you may want to get only the logs specific to the functionality that you are currently looking into. So that is where this functionality element that we added into our package comes into play. To obtain this we would update the parameters as shown below. log4j.logger.com.ww.myproject.myfunction=DEBUG Further to drill down you can enable or disable the logs specific to those flow to get more granular set of messages as shown below for flow2. We can add multiple similar lines for each flow if we need such small sets of logs for specific flows and avoid rest of the log messages. log4j.logger.com.ww.myproject.myfunction.flow2=DEBUG 6
  • 7. 2015 © WHISHWORKS. All rights reserved. WHISHWORKS Confidential Conclusion After debugging process this line should be either commented or removed from the log4j.properties file so we stop producing the huge set of logs file containing detailed debug messages. By putting this into practice we can ensure that the customers as well as the support team would appreciate the efforts put into this. This would help the support team to look into the logs and get debug messages so as to analyze the issue that are investigated. This would reduce the investigation time, to narrow down to the root cause and to provide appropriate fix with a short turnaround time. 7