Mule ESB
Add a logger to existing flow
Before continuing…
Make sure you’ve already completed slides:
Mule esb first http connector
Or watched video:
Mule ESB First HTTP Connector
OpenAnypointStudio
Let’sopenour«myfirstproject»
OpenMessageFlow
FromMulePaletteview,searchfor
«logger»and selectthefirstone.
DragandDrop LoggerintoMessage
Flowview,afterSetPayload
DoubleclickonLogger
onbelowLoggerviewlet’sconfigureour
logmessage.Inthisexamplewekeepa
prefixandthenthepayloadmessage
(configuredinSetPayloadblock):
#['IAmloggingthemessage:'+payload]
ClickonSAVEattop-leftofscreen
NowwecanstartourMuleserver
RightClickonmyfirstprojectRunAs
MuleApplication
OntheConsoleviewbelowserverisgoing
tostart
Attheendyouwillseethestatus
DEPLOYED
*******************************
*******************************
*myfirstproject *default
*DEPLOYED *
*******************************
*******************************
Thismeansthatserverisupandrunning
FromWebBrowser(IE,Chrome,orwhat
youwant)let’sinvokeour service
endpoint:
http://localhost:8081/myfirstFlow
Ifeverithingisokyouwillseethepayload
------------------------------------------------
Thistime,onConsole,thereisalsothelog
messagecomposedbefore.
TheparthighlightedinREDisourcustom
message
TheparthighlightedinBLUEisourpayload
Enjoy with Mule!