SlideShare a Scribd company logo
Advanced Logging Patterns with
Platform Events
@andyinthecloud
Andrew Fawcett, CTO, FinancialForce
Andrew Fawcett
CTO, FinancialForce
Blogger, Author, Salesforce MVP
Customer or
Salesforce Logo
About FinancialForce
SF+FF Solutions 700+
Financial Management,
Professional Services Automation,
Billing Central, & Revenue
Recognition & Forecasting
1,400+ 40% YoY $110M
#1 Cloud ERP on Salesforce
The largest Salesforce partner
Employees across 7 offices
HQ in San Francisco, CA
Subscription revenue growthCustomers in 34+ countries
With users in 50+ countries
Run rate
20% investment from Salesforce
Plus investments from TCV & Unit 4
3
Logging Requirements
Flexibility, easy of use, analytics, security and efficiency
Logging Requirements
Flexibility
• Ability to log any arbitrary text and reportable information (e.g. resource usage)
Easy to use
• Low touch for developers, simple but powerful, should not clutter code
Analytics and Active Monitoring
• Ability for developers and admins to view (ideally live) and derive actions from
Security
• Logged results should be controlled by security constraints
Efficiency
• All logging will add some overhead, but should be kept to minimal
Flexibility, easy of use, analytics, security and efficiency
Brief Introduction to Platform Events
What? Why? Creating them, sending and receiving them!
Introduction to Platform Events
What is an “Event” ?
• A “message” to be shared to one or more interested parties
What are they? Use cases?
Roger Mitchell
Cofounder @BluestoneLabsIO
“it’s like Twitter
and IFTTT
together”
“making part of the
work easier to
customize and adapt to
a specific biz process
across multiple orgs &
depts”
Bonny Hinners
Founder at RealtelephonyEvent
Process A
Message
Send
Process B
Process C
Message
Send
Use cases?
•Respond to activity occurring in the outside world, such as
device status or other platforms (Heroku)
•Differ work into the background to improve page response times
•Send and receive telemetry from your Apex/PB/Flow processes
for realtime and retrospective monitoring and review
Introduction to Platform Events
Creating Platform Events
• Created via Setup, MD API, IDE etc
• Fields define the content of the message / event
Send and Receiving
•Lots API’s available on and off platform
•Tools such as Process Builder and Flow #clicksnotcode
Creating them, sending and receiving them
Logging with Platform Events
Realtime, capturable and actionable
Advanced Logging with Platform Events
Flexibility
• Multiple log listeners to filter and forward log events, e.g. recording logs
Easy to use
• Sent and received on multiple platforms, languages and tools
Analytics and Active Monitoring
• Monitored live via CometD streaming libraries, no polling!
• Can contain text and numeric data values for filtering and reporting
Security
• Controlled via standard Profile and Permission Sets
Efficiency
•Low impact on executing process / code, outside transaction
Requirements checklist
✔
✔
✔
✔
✔
Advanced Logging with Platform Events
Configure access
• Permission Sets can be used to
control who sends (create) and who
receives (read) log events
Careful what you log!
• Despite the security controls, be
careful what you log
•No, guarantees where data ends up
•No, session Id’s
•No, record data, think privacy
Security considerations
Introducing Platform Event Logging
Platform agnostic sending, capture and monitoring
Apex Language
•Send via EventBus.publish method
•Receive via Trigger
Advanced Logging with Platform Events
Sending and receiving log events
Salesforce API’s
•Send via record insert into event object
•Receive via CometD API
• Various libraries for Java, JavaScript etc..
Lightning Components
•Receive via Streaming Component
•Wraps CometD JavaScript API
Demo
Sending via Salesforce REST API (Salesforce Workbench)
Receiving via Streaming Lightning Component
Advanced Logging with Platform Events
Sending and receiving log events
Process Builder
•Send via record insert into event object
•Receiving, must map event data to an
existing Standard/Custom object record
Flow
•Send via record insert into event object
•Use Wait element to wait for messages
and filter them with criteria
Logging in Apex
Generating log events from Apex
Logging in Apex
Features
• Supports nested / scoped logging
• Buffers in memory
• Automatically records limits usage
• Useful for profiling Apex code
Log Class
2017-10-22 21:03:50.177
1:MyClass.methodA (DML 2,SQL 2)
2:MyClass.methodB (DML 1)
3:Doing something
2:MyClass.methodC (SQL 1)
2:Doing something else
Demo
Logging via the Log class
Monitoring Logs via Lightning
Logging Lightning Component
Log Viewer Lightning Component
Lightning Features used
• Lightning Base Component (lightning:tree)
•Lightning Streaming Component (c:streaming)
• Lightning Utility Bar displays logs real time while using the app
• Lightning Record Page Component (when displaying recorded logs)
•Lightning Data Services (lightning:recordData)
Parses the Log Event data and displays via Lightning Tree Component
Called by Apply Discount button
• Add to Service class
•OpportunitiesService.applyDiscounts
• Add to Domain class
•Opportunties.applyDiscounts
•OpportunityLines.applyDiscounts
• Add to Unit of Work class
•fflib_SObjectUnitOfWork.commitWork
Profiling Apex Code with the Log Class
via the Apex Enterprise Patterns Sample App
Demo
Monitoring Logs within Lightning Experience
Filtering and Capturing Log Events
With Process Builder
Capturing Log Events with Process Builder
Create a process that starts when a platform event occurs!
Capturing Log Events with Process Builder
Process Builder Receives Events and Filters them
• Using the Wait Element
• Filter criteria example …
“capture log events if more than 1 SOQL statement is used
when executing applying discounts logic”
Applying filter criteria
TIP: Events need to be mapped to a record in Process Builder. You can use the User record if you
don’t have an existing record (as is the case here).
Capturing Log Events with Process Builder
Log Recording custom object
is used to captured logs via Create a Record
• Record level Lightning Component displays
formatted log output
• Note assignment of OwnerId field (optional)
Displaying recorded logs
Demo
Filtering and Capturing Logs with Flow
Wrap up
Summary and Resources
Resources
Documentation
•Lightning Developer Guide
•Platform Events Developer Guide
Blog
• http://andyinthecloud.com
Demo Code
•https://github.com/afawcett/eventlogging
Documentation, Blog and Demo Code
Q&A
Dreamforce 2017 - Advanced Logging Patterns with Platform Events

More Related Content

What's hot

Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
Salesforce Developers
 
Salesforce Connect
Salesforce Connect Salesforce Connect
Salesforce Connect
Jitendra Joysar ☁
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
Salesforce Developers
 
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce IntroductionSalesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
Habilelabs
 
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Sam Garforth
 
Best practices for salesforce cpq implementation
Best practices for salesforce cpq implementationBest practices for salesforce cpq implementation
Best practices for salesforce cpq implementation
Anjali Mudgal
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
Mohammed Safwat Abu Kwaik
 
Salesforce Marketing Cloud overview demo
Salesforce Marketing Cloud overview demoSalesforce Marketing Cloud overview demo
Salesforce Marketing Cloud overview demo
Adama Sidibé
 
Salesforce
SalesforceSalesforce
Salesforce
maheswara reddy
 
Salesforce complete overview
Salesforce complete overviewSalesforce complete overview
Salesforce complete overview
Nitesh Mishra ☁
 
Power of Einstein Analytics - Salesforce + Mulesoft
Power of Einstein Analytics - Salesforce + Mulesoft Power of Einstein Analytics - Salesforce + Mulesoft
Power of Einstein Analytics - Salesforce + Mulesoft
Akshata Sawant
 
Salesforce Deck Template
Salesforce Deck TemplateSalesforce Deck Template
Salesforce Deck Template
Phil Weinmeister
 
Building a Center of Excellence for your Salesforce crm team
Building a Center of Excellence for your Salesforce crm teamBuilding a Center of Excellence for your Salesforce crm team
Building a Center of Excellence for your Salesforce crm team
Buyan Thyagarajan
 
Introduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelIntroduction to the Salesforce Security Model
Introduction to the Salesforce Security Model
Salesforce Developers
 
How to Use the Activity Custom Lookup Field to Get More Out of Events and Tas...
How to Use the Activity Custom Lookup Field to Get More Out of Events and Tas...How to Use the Activity Custom Lookup Field to Get More Out of Events and Tas...
How to Use the Activity Custom Lookup Field to Get More Out of Events and Tas...
Salesforce Admins
 
SOQL & SOSL for Admins
SOQL & SOSL for AdminsSOQL & SOSL for Admins
SOQL & SOSL for Admins
Obidjon Komiljonov
 
Salesforce Partner Program for ISV Partners
Salesforce Partner Program for ISV PartnersSalesforce Partner Program for ISV Partners
Salesforce Partner Program for ISV Partners
Salesforce Partners
 
Salesforce Steelbrick CPQ Overview
Salesforce Steelbrick CPQ OverviewSalesforce Steelbrick CPQ Overview
Salesforce Steelbrick CPQ Overview
Harshala Shewale ☁
 
Data model in salesforce
Data model in salesforceData model in salesforce
Data model in salesforce
Chamil Madusanka
 
Salesforce Lightning workshop
Salesforce Lightning workshopSalesforce Lightning workshop
Salesforce Lightning workshop
Shivanath Devinarayanan
 

What's hot (20)

Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
Salesforce Connect
Salesforce Connect Salesforce Connect
Salesforce Connect
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce IntroductionSalesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
 
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
Salesforce Application Lifecycle Management presented to EA Forum by Sam Garf...
 
Best practices for salesforce cpq implementation
Best practices for salesforce cpq implementationBest practices for salesforce cpq implementation
Best practices for salesforce cpq implementation
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
 
Salesforce Marketing Cloud overview demo
Salesforce Marketing Cloud overview demoSalesforce Marketing Cloud overview demo
Salesforce Marketing Cloud overview demo
 
Salesforce
SalesforceSalesforce
Salesforce
 
Salesforce complete overview
Salesforce complete overviewSalesforce complete overview
Salesforce complete overview
 
Power of Einstein Analytics - Salesforce + Mulesoft
Power of Einstein Analytics - Salesforce + Mulesoft Power of Einstein Analytics - Salesforce + Mulesoft
Power of Einstein Analytics - Salesforce + Mulesoft
 
Salesforce Deck Template
Salesforce Deck TemplateSalesforce Deck Template
Salesforce Deck Template
 
Building a Center of Excellence for your Salesforce crm team
Building a Center of Excellence for your Salesforce crm teamBuilding a Center of Excellence for your Salesforce crm team
Building a Center of Excellence for your Salesforce crm team
 
Introduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelIntroduction to the Salesforce Security Model
Introduction to the Salesforce Security Model
 
How to Use the Activity Custom Lookup Field to Get More Out of Events and Tas...
How to Use the Activity Custom Lookup Field to Get More Out of Events and Tas...How to Use the Activity Custom Lookup Field to Get More Out of Events and Tas...
How to Use the Activity Custom Lookup Field to Get More Out of Events and Tas...
 
SOQL & SOSL for Admins
SOQL & SOSL for AdminsSOQL & SOSL for Admins
SOQL & SOSL for Admins
 
Salesforce Partner Program for ISV Partners
Salesforce Partner Program for ISV PartnersSalesforce Partner Program for ISV Partners
Salesforce Partner Program for ISV Partners
 
Salesforce Steelbrick CPQ Overview
Salesforce Steelbrick CPQ OverviewSalesforce Steelbrick CPQ Overview
Salesforce Steelbrick CPQ Overview
 
Data model in salesforce
Data model in salesforceData model in salesforce
Data model in salesforce
 
Salesforce Lightning workshop
Salesforce Lightning workshopSalesforce Lightning workshop
Salesforce Lightning workshop
 

Similar to Dreamforce 2017 - Advanced Logging Patterns with Platform Events

Salesforce Winter 23 Release Webinar Slide Deck
Salesforce Winter 23 Release Webinar Slide DeckSalesforce Winter 23 Release Webinar Slide Deck
Salesforce Winter 23 Release Webinar Slide Deck
brightgenss
 
ReflectInsight - Let your application speak volume
ReflectInsight - Let your application speak volumeReflectInsight - Let your application speak volume
ReflectInsight - Let your application speak volume
Callon Campbell
 
A2019 presentation
A2019 presentationA2019 presentation
A2019 presentation
sneha324350
 
The differing ways to monitor and instrument
The differing ways to monitor and instrumentThe differing ways to monitor and instrument
The differing ways to monitor and instrument
Jonah Kowall
 
Flow like a Rockstar @ SharePoint Saturday The Netherlands
Flow like a Rockstar @ SharePoint Saturday The NetherlandsFlow like a Rockstar @ SharePoint Saturday The Netherlands
Flow like a Rockstar @ SharePoint Saturday The Netherlands
Daniel Laskewitz
 
Intro to Telegraf
Intro to TelegrafIntro to Telegraf
Intro to Telegraf
InfluxData
 
Anypoint monitoring capabilities
Anypoint monitoring capabilitiesAnypoint monitoring capabilities
Anypoint monitoring capabilities
MarioMartinez88103
 
Anypoint monitoring capabilities
Anypoint monitoring capabilitiesAnypoint monitoring capabilities
Anypoint monitoring capabilities
MarioMartinez88103
 
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Amazon Web Services
 
Peloton Cycle Streaming Live Spin Classes to Thousands with Loggly & AWS
Peloton Cycle  Streaming Live Spin Classes to Thousands with Loggly & AWSPeloton Cycle  Streaming Live Spin Classes to Thousands with Loggly & AWS
Peloton Cycle Streaming Live Spin Classes to Thousands with Loggly & AWS
Amazon Web Services
 
User activity monitoring with SysKit
User activity monitoring with SysKitUser activity monitoring with SysKit
User activity monitoring with SysKit
SysKit Ltd
 
Feature drift monitoring as a service for machine learning models at scale
Feature drift monitoring as a service for machine learning models at scaleFeature drift monitoring as a service for machine learning models at scale
Feature drift monitoring as a service for machine learning models at scale
Noriaki Tatsumi
 
ProcessFlow/IPA Differences
ProcessFlow/IPA DifferencesProcessFlow/IPA Differences
ProcessFlow/IPA Differences
Nogalis Inc
 
Cashing in on logging and exception data
Cashing in on logging and exception dataCashing in on logging and exception data
Cashing in on logging and exception data
Stackify
 
Framework and Product Comparison for Big Data Log Analytics and ITOA
Framework and Product Comparison for Big Data Log Analytics and ITOA Framework and Product Comparison for Big Data Log Analytics and ITOA
Framework and Product Comparison for Big Data Log Analytics and ITOA
Kai Wähner
 
Building an Observability Platform in 389 Difficult Steps
Building an Observability Platform in 389 Difficult StepsBuilding an Observability Platform in 389 Difficult Steps
Building an Observability Platform in 389 Difficult Steps
DigitalOcean
 
Analyzing OTM Logs and Troubleshooting
Analyzing OTM Logs and TroubleshootingAnalyzing OTM Logs and Troubleshooting
Analyzing OTM Logs and Troubleshooting
MavenWire
 
#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph
#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph
#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph
Vincent Biret
 
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Piyush Kumar
 
Choosing the Best Business Intelligence Security Model for Your App
Choosing the Best Business Intelligence Security Model for Your AppChoosing the Best Business Intelligence Security Model for Your App
Choosing the Best Business Intelligence Security Model for Your App
Logi Analytics
 

Similar to Dreamforce 2017 - Advanced Logging Patterns with Platform Events (20)

Salesforce Winter 23 Release Webinar Slide Deck
Salesforce Winter 23 Release Webinar Slide DeckSalesforce Winter 23 Release Webinar Slide Deck
Salesforce Winter 23 Release Webinar Slide Deck
 
ReflectInsight - Let your application speak volume
ReflectInsight - Let your application speak volumeReflectInsight - Let your application speak volume
ReflectInsight - Let your application speak volume
 
A2019 presentation
A2019 presentationA2019 presentation
A2019 presentation
 
The differing ways to monitor and instrument
The differing ways to monitor and instrumentThe differing ways to monitor and instrument
The differing ways to monitor and instrument
 
Flow like a Rockstar @ SharePoint Saturday The Netherlands
Flow like a Rockstar @ SharePoint Saturday The NetherlandsFlow like a Rockstar @ SharePoint Saturday The Netherlands
Flow like a Rockstar @ SharePoint Saturday The Netherlands
 
Intro to Telegraf
Intro to TelegrafIntro to Telegraf
Intro to Telegraf
 
Anypoint monitoring capabilities
Anypoint monitoring capabilitiesAnypoint monitoring capabilities
Anypoint monitoring capabilities
 
Anypoint monitoring capabilities
Anypoint monitoring capabilitiesAnypoint monitoring capabilities
Anypoint monitoring capabilities
 
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
 
Peloton Cycle Streaming Live Spin Classes to Thousands with Loggly & AWS
Peloton Cycle  Streaming Live Spin Classes to Thousands with Loggly & AWSPeloton Cycle  Streaming Live Spin Classes to Thousands with Loggly & AWS
Peloton Cycle Streaming Live Spin Classes to Thousands with Loggly & AWS
 
User activity monitoring with SysKit
User activity monitoring with SysKitUser activity monitoring with SysKit
User activity monitoring with SysKit
 
Feature drift monitoring as a service for machine learning models at scale
Feature drift monitoring as a service for machine learning models at scaleFeature drift monitoring as a service for machine learning models at scale
Feature drift monitoring as a service for machine learning models at scale
 
ProcessFlow/IPA Differences
ProcessFlow/IPA DifferencesProcessFlow/IPA Differences
ProcessFlow/IPA Differences
 
Cashing in on logging and exception data
Cashing in on logging and exception dataCashing in on logging and exception data
Cashing in on logging and exception data
 
Framework and Product Comparison for Big Data Log Analytics and ITOA
Framework and Product Comparison for Big Data Log Analytics and ITOA Framework and Product Comparison for Big Data Log Analytics and ITOA
Framework and Product Comparison for Big Data Log Analytics and ITOA
 
Building an Observability Platform in 389 Difficult Steps
Building an Observability Platform in 389 Difficult StepsBuilding an Observability Platform in 389 Difficult Steps
Building an Observability Platform in 389 Difficult Steps
 
Analyzing OTM Logs and Troubleshooting
Analyzing OTM Logs and TroubleshootingAnalyzing OTM Logs and Troubleshooting
Analyzing OTM Logs and Troubleshooting
 
#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph
#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph
#Techorama belgium 2018 vincent biret deep dive with the #MicrosoftGraph
 
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
Importance of ‘Centralized Event collection’ and BigData platform for Analysis !
 
Choosing the Best Business Intelligence Security Model for Your App
Choosing the Best Business Intelligence Security Model for Your AppChoosing the Best Business Intelligence Security Model for Your App
Choosing the Best Business Intelligence Security Model for Your App
 

More from andyinthecloud

PhillyForce 2018 - Salesforce Platform Keynote
PhillyForce 2018  - Salesforce Platform KeynotePhillyForce 2018  - Salesforce Platform Keynote
PhillyForce 2018 - Salesforce Platform Keynote
andyinthecloud
 
Dreamforce 2017 - Up close and personal with Lightning Experience as Platform
Dreamforce 2017 - Up close and personal with Lightning Experience as PlatformDreamforce 2017 - Up close and personal with Lightning Experience as Platform
Dreamforce 2017 - Up close and personal with Lightning Experience as Platform
andyinthecloud
 
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any PlatformSalesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
andyinthecloud
 
Internet of things the salesforce lego machine cloud
Internet of things   the salesforce lego machine cloudInternet of things   the salesforce lego machine cloud
Internet of things the salesforce lego machine cloud
andyinthecloud
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patterns
andyinthecloud
 
Go Faster with Process Builder
Go Faster with Process BuilderGo Faster with Process Builder
Go Faster with Process Builder
andyinthecloud
 

More from andyinthecloud (6)

PhillyForce 2018 - Salesforce Platform Keynote
PhillyForce 2018  - Salesforce Platform KeynotePhillyForce 2018  - Salesforce Platform Keynote
PhillyForce 2018 - Salesforce Platform Keynote
 
Dreamforce 2017 - Up close and personal with Lightning Experience as Platform
Dreamforce 2017 - Up close and personal with Lightning Experience as PlatformDreamforce 2017 - Up close and personal with Lightning Experience as Platform
Dreamforce 2017 - Up close and personal with Lightning Experience as Platform
 
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any PlatformSalesforce World Tour 2016 : Lightning Out : Components on any Platform
Salesforce World Tour 2016 : Lightning Out : Components on any Platform
 
Internet of things the salesforce lego machine cloud
Internet of things   the salesforce lego machine cloudInternet of things   the salesforce lego machine cloud
Internet of things the salesforce lego machine cloud
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patterns
 
Go Faster with Process Builder
Go Faster with Process BuilderGo Faster with Process Builder
Go Faster with Process Builder
 

Recently uploaded

Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
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
 
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
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
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
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
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
 
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
 
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
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
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
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 

Recently uploaded (20)

Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
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...
 
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"
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
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
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
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 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
 
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
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
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
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 

Dreamforce 2017 - Advanced Logging Patterns with Platform Events

  • 1. Advanced Logging Patterns with Platform Events @andyinthecloud Andrew Fawcett, CTO, FinancialForce
  • 2. Andrew Fawcett CTO, FinancialForce Blogger, Author, Salesforce MVP Customer or Salesforce Logo
  • 3. About FinancialForce SF+FF Solutions 700+ Financial Management, Professional Services Automation, Billing Central, & Revenue Recognition & Forecasting 1,400+ 40% YoY $110M #1 Cloud ERP on Salesforce The largest Salesforce partner Employees across 7 offices HQ in San Francisco, CA Subscription revenue growthCustomers in 34+ countries With users in 50+ countries Run rate 20% investment from Salesforce Plus investments from TCV & Unit 4 3
  • 4. Logging Requirements Flexibility, easy of use, analytics, security and efficiency
  • 5. Logging Requirements Flexibility • Ability to log any arbitrary text and reportable information (e.g. resource usage) Easy to use • Low touch for developers, simple but powerful, should not clutter code Analytics and Active Monitoring • Ability for developers and admins to view (ideally live) and derive actions from Security • Logged results should be controlled by security constraints Efficiency • All logging will add some overhead, but should be kept to minimal Flexibility, easy of use, analytics, security and efficiency
  • 6. Brief Introduction to Platform Events What? Why? Creating them, sending and receiving them!
  • 7. Introduction to Platform Events What is an “Event” ? • A “message” to be shared to one or more interested parties What are they? Use cases? Roger Mitchell Cofounder @BluestoneLabsIO “it’s like Twitter and IFTTT together” “making part of the work easier to customize and adapt to a specific biz process across multiple orgs & depts” Bonny Hinners Founder at RealtelephonyEvent Process A Message Send Process B Process C Message Send Use cases? •Respond to activity occurring in the outside world, such as device status or other platforms (Heroku) •Differ work into the background to improve page response times •Send and receive telemetry from your Apex/PB/Flow processes for realtime and retrospective monitoring and review
  • 8. Introduction to Platform Events Creating Platform Events • Created via Setup, MD API, IDE etc • Fields define the content of the message / event Send and Receiving •Lots API’s available on and off platform •Tools such as Process Builder and Flow #clicksnotcode Creating them, sending and receiving them
  • 9. Logging with Platform Events Realtime, capturable and actionable
  • 10. Advanced Logging with Platform Events Flexibility • Multiple log listeners to filter and forward log events, e.g. recording logs Easy to use • Sent and received on multiple platforms, languages and tools Analytics and Active Monitoring • Monitored live via CometD streaming libraries, no polling! • Can contain text and numeric data values for filtering and reporting Security • Controlled via standard Profile and Permission Sets Efficiency •Low impact on executing process / code, outside transaction Requirements checklist ✔ ✔ ✔ ✔ ✔
  • 11. Advanced Logging with Platform Events Configure access • Permission Sets can be used to control who sends (create) and who receives (read) log events Careful what you log! • Despite the security controls, be careful what you log •No, guarantees where data ends up •No, session Id’s •No, record data, think privacy Security considerations
  • 12. Introducing Platform Event Logging Platform agnostic sending, capture and monitoring
  • 13. Apex Language •Send via EventBus.publish method •Receive via Trigger Advanced Logging with Platform Events Sending and receiving log events Salesforce API’s •Send via record insert into event object •Receive via CometD API • Various libraries for Java, JavaScript etc.. Lightning Components •Receive via Streaming Component •Wraps CometD JavaScript API
  • 14. Demo Sending via Salesforce REST API (Salesforce Workbench) Receiving via Streaming Lightning Component
  • 15. Advanced Logging with Platform Events Sending and receiving log events Process Builder •Send via record insert into event object •Receiving, must map event data to an existing Standard/Custom object record Flow •Send via record insert into event object •Use Wait element to wait for messages and filter them with criteria
  • 16. Logging in Apex Generating log events from Apex
  • 17. Logging in Apex Features • Supports nested / scoped logging • Buffers in memory • Automatically records limits usage • Useful for profiling Apex code Log Class 2017-10-22 21:03:50.177 1:MyClass.methodA (DML 2,SQL 2) 2:MyClass.methodB (DML 1) 3:Doing something 2:MyClass.methodC (SQL 1) 2:Doing something else
  • 18. Demo Logging via the Log class
  • 19. Monitoring Logs via Lightning Logging Lightning Component
  • 20. Log Viewer Lightning Component Lightning Features used • Lightning Base Component (lightning:tree) •Lightning Streaming Component (c:streaming) • Lightning Utility Bar displays logs real time while using the app • Lightning Record Page Component (when displaying recorded logs) •Lightning Data Services (lightning:recordData) Parses the Log Event data and displays via Lightning Tree Component
  • 21. Called by Apply Discount button • Add to Service class •OpportunitiesService.applyDiscounts • Add to Domain class •Opportunties.applyDiscounts •OpportunityLines.applyDiscounts • Add to Unit of Work class •fflib_SObjectUnitOfWork.commitWork Profiling Apex Code with the Log Class via the Apex Enterprise Patterns Sample App
  • 22. Demo Monitoring Logs within Lightning Experience
  • 23. Filtering and Capturing Log Events With Process Builder
  • 24. Capturing Log Events with Process Builder Create a process that starts when a platform event occurs!
  • 25. Capturing Log Events with Process Builder Process Builder Receives Events and Filters them • Using the Wait Element • Filter criteria example … “capture log events if more than 1 SOQL statement is used when executing applying discounts logic” Applying filter criteria TIP: Events need to be mapped to a record in Process Builder. You can use the User record if you don’t have an existing record (as is the case here).
  • 26. Capturing Log Events with Process Builder Log Recording custom object is used to captured logs via Create a Record • Record level Lightning Component displays formatted log output • Note assignment of OwnerId field (optional) Displaying recorded logs
  • 28. Wrap up Summary and Resources
  • 29. Resources Documentation •Lightning Developer Guide •Platform Events Developer Guide Blog • http://andyinthecloud.com Demo Code •https://github.com/afawcett/eventlogging Documentation, Blog and Demo Code
  • 30. Q&A