SlideShare a Scribd company logo
1 of 64
Download to read offline
by Paula Čučuk, Locastic 21.9.2023. / API Platform Conference 2023
Tracking user activity
logs using Loggastic
Paula Čučuk
paula@locastic.com
@paoolala
Partner & Lead backend developer @ Locastic
Software solutions for
business challenges.
locastic.com
Intro
The goal
Track each change made on data + custom actions not related to database
changes
Ability to define which data should be tracked, including fields from relations
User friendly logs view
Support for large amount of data and fast browsing
Logging should not slow down the response time
What should log contain?
Entity name
Action (create, edit, delete)
Datetime
Before/after values
User
Existing solutions
Loggable behavioural
Doctrine extension
Loggable behavioural Doctrine extension
Loggable behavioural Doctrine extension
Track each change made on data + custom actions not related to changing data
Ability to define which data should be tracked, including fields from relations
User friendly logs view
Support for large amount of data and fast browsing
Logging should not slow down the response time
EXTRA: Ability to rollback the data to the previous state
Loggastic
Loggastic - logging flow
Listen loggable
objects actions
CREATE
EDIT
DELETE
Send message to
Symfony
messenger
Compare data Elastic
Search
Loggastic - displaying logs
Elastic
Search
Read logs
Expose to
ApiPlatform
endpoint
Expose to Twig
view
Loggastic - elastic indexes
<entity_name>_activity_log
<entity_name>_current_data_tracker
Contains current
object data used for
comparing changed
object
Needs to be up to date
with database values
Contains actual
activity logs for
current object
Loggastic
implementation
1. Installation
composer require locastic/loggastic
2. Making an entity loggable
2. Making an entity loggable
2. Making an entity loggable
2. Making an entity loggable
3. Run commands for creating Elastic indexes
bin/console locastic:activity-logs:create-loggable-indexes
bin/console locastic:activity-logs:populate-current-data-trackers
If you already have some data in database:
Done! Activity logs are now tracked
Create product
Edit product
Delete product
4. Displaying activity logs
Displaying activity logs : Api platform
Displaying activity logs : Api platform
Displaying activity logs : Api platform
Displaying activity logs : Twig
Displaying activity logs : Twig
Basic implementation summary
Add Loggable attribute to entity and serialization groups to
properties
Run command for creating indexes
Expose an api endpoint or display logs in twig
Customizations
Configuration reference
Configuration
reference -
Elastic indexes
Customising logged data
Custom user fields
Custom user fields
Custom user fields
Custom user fields
Collection keys
Custom Collection keys
Handeling relations
Activity log is not saved!
Handeling relations
Handeling relations
Changing the default
loggable listener
Turning off the default listener
Creating your own listener
Creating
your own
listener
Custom action name
Save edit log when no changes were made
Optimisation
Making logs async
Different consumers per entity (AMQP)
Different consumers per entity
Pros / Cons
Pros
Quick and easy implementation
Flexible & customisable
Meets all of our goals
Helpful in debugging
Complex setup
Keeping data up to date
Cons
How does it work
on real projects?
1.5 million
Number of activity
Log records
< 200ms
Sylius & ApiPlatform project
GET /activity-logs
response time
Future plans
Future plans
Add support for other data storages
Add more abilities for customisation
Sylius plugin
Keep testing it and fix any found issues
Contributing
Thank you!
Questions?
Paula Čučuk
paula@locastic.com
@paoolala
Partner & Lead backend developer @ Locastic

More Related Content

Similar to Tracking user activity logs using Loggastic #ApiPlatformCon

ELK Solutions Enablement Session - 17th March'2020
ELK Solutions Enablement Session - 17th March'2020ELK Solutions Enablement Session - 17th March'2020
ELK Solutions Enablement Session - 17th March'2020Ashnikbiz
 
Getting It System Toolkit: Enhancing User Experience & Customizing a Future f...
Getting It System Toolkit: Enhancing User Experience & Customizing a Future f...Getting It System Toolkit: Enhancing User Experience & Customizing a Future f...
Getting It System Toolkit: Enhancing User Experience & Customizing a Future f...Tim Bowersox
 
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...Ivan Sanders
 
Business Objects Service Pack Upgrade
Business Objects Service Pack UpgradeBusiness Objects Service Pack Upgrade
Business Objects Service Pack UpgradeWiiisdom
 
Alfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti
Alfresco Day Amsterdam 2015, Technical Track - Doing more with ActivitiAlfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti
Alfresco Day Amsterdam 2015, Technical Track - Doing more with ActivitiAlfresco Software
 
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...Christoph Adler
 
Data Ingestion in Big Data and IoT platforms
Data Ingestion in Big Data and IoT platformsData Ingestion in Big Data and IoT platforms
Data Ingestion in Big Data and IoT platformsGuido Schmutz
 
1 content optimization-hug-2010-07-21
1 content optimization-hug-2010-07-211 content optimization-hug-2010-07-21
1 content optimization-hug-2010-07-21Hadoop User Group
 
Pentaho data integration 4.0 and my sql
Pentaho data integration 4.0 and my sqlPentaho data integration 4.0 and my sql
Pentaho data integration 4.0 and my sqlAHMED ENNAJI
 
Salesforce Spring 14 Release Developer Overview
Salesforce Spring 14 Release Developer OverviewSalesforce Spring 14 Release Developer Overview
Salesforce Spring 14 Release Developer OverviewRoy Gilad
 
Meetup milano #4 log management and anypoint advanced monitoring
Meetup milano #4   log management and anypoint advanced monitoringMeetup milano #4   log management and anypoint advanced monitoring
Meetup milano #4 log management and anypoint advanced monitoringGonzalo Marcos Ansoain
 
Solve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesSolve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesCory Peters
 
Moving Data in and out of Reltio - It-s Super EASY.pdf
Moving Data in and out of Reltio - It-s Super EASY.pdfMoving Data in and out of Reltio - It-s Super EASY.pdf
Moving Data in and out of Reltio - It-s Super EASY.pdfAlex446314
 
CC Technology Summit 3 Update
CC Technology Summit 3 UpdateCC Technology Summit 3 Update
CC Technology Summit 3 UpdateNathan Yergler
 
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...Christoph Adler
 
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
 
Norfolk Intranet 2.0
Norfolk Intranet 2.0Norfolk Intranet 2.0
Norfolk Intranet 2.0djoneseaccess
 
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & RestoreLadies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restoregemziebeth
 

Similar to Tracking user activity logs using Loggastic #ApiPlatformCon (20)

ELK Solutions Enablement Session - 17th March'2020
ELK Solutions Enablement Session - 17th March'2020ELK Solutions Enablement Session - 17th March'2020
ELK Solutions Enablement Session - 17th March'2020
 
Getting It System Toolkit: Enhancing User Experience & Customizing a Future f...
Getting It System Toolkit: Enhancing User Experience & Customizing a Future f...Getting It System Toolkit: Enhancing User Experience & Customizing a Future f...
Getting It System Toolkit: Enhancing User Experience & Customizing a Future f...
 
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
 
Business Objects Service Pack Upgrade
Business Objects Service Pack UpgradeBusiness Objects Service Pack Upgrade
Business Objects Service Pack Upgrade
 
Alfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti
Alfresco Day Amsterdam 2015, Technical Track - Doing more with ActivitiAlfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti
Alfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti
 
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...
 
Data Ingestion in Big Data and IoT platforms
Data Ingestion in Big Data and IoT platformsData Ingestion in Big Data and IoT platforms
Data Ingestion in Big Data and IoT platforms
 
1 content optimization-hug-2010-07-21
1 content optimization-hug-2010-07-211 content optimization-hug-2010-07-21
1 content optimization-hug-2010-07-21
 
Pentaho data integration 4.0 and my sql
Pentaho data integration 4.0 and my sqlPentaho data integration 4.0 and my sql
Pentaho data integration 4.0 and my sql
 
Tracking Active Directory Changes
Tracking Active Directory ChangesTracking Active Directory Changes
Tracking Active Directory Changes
 
Audit logging
Audit loggingAudit logging
Audit logging
 
Salesforce Spring 14 Release Developer Overview
Salesforce Spring 14 Release Developer OverviewSalesforce Spring 14 Release Developer Overview
Salesforce Spring 14 Release Developer Overview
 
Meetup milano #4 log management and anypoint advanced monitoring
Meetup milano #4   log management and anypoint advanced monitoringMeetup milano #4   log management and anypoint advanced monitoring
Meetup milano #4 log management and anypoint advanced monitoring
 
Solve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesSolve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 Features
 
Moving Data in and out of Reltio - It-s Super EASY.pdf
Moving Data in and out of Reltio - It-s Super EASY.pdfMoving Data in and out of Reltio - It-s Super EASY.pdf
Moving Data in and out of Reltio - It-s Super EASY.pdf
 
CC Technology Summit 3 Update
CC Technology Summit 3 UpdateCC Technology Summit 3 Update
CC Technology Summit 3 Update
 
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...
 
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 !
 
Norfolk Intranet 2.0
Norfolk Intranet 2.0Norfolk Intranet 2.0
Norfolk Intranet 2.0
 
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & RestoreLadies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
 

Recently uploaded

Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 

Recently uploaded (20)

Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 

Tracking user activity logs using Loggastic #ApiPlatformCon