Tracking user activity logs using Loggastic #ApiPlatformCon

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
1 sur 64

Recommandé

UCIAD overview par
UCIAD overviewUCIAD overview
UCIAD overviewMathieu d'Aquin
830 vues26 diapositives
Spring 15 par
Spring 15Spring 15
Spring 15Jyothylakshmy P.U
321 vues18 diapositives
Best practices for migrating from SharePoint Designer to Power Automate par
Best practices for migrating from SharePoint Designer to Power AutomateBest practices for migrating from SharePoint Designer to Power Automate
Best practices for migrating from SharePoint Designer to Power AutomateWilliam Huneycutt, II
1.1K vues60 diapositives
Stefaan Ponnet, Fusebox par
Stefaan Ponnet, FuseboxStefaan Ponnet, Fusebox
Stefaan Ponnet, Fuseboxnascomgenk
1.6K vues27 diapositives
ELK Solutions Enablement Session - 17th March'2020 par
ELK Solutions Enablement Session - 17th March'2020ELK Solutions Enablement Session - 17th March'2020
ELK Solutions Enablement Session - 17th March'2020Ashnikbiz
156 vues55 diapositives
Getting It System Toolkit: Enhancing User Experience & Customizing a Future f... par
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
181 vues53 diapositives

Contenu connexe

Similaire à Tracking user activity logs using Loggastic #ApiPlatformCon

Alfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti par
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
512 vues10 diapositives
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ... par
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
226 vues66 diapositives
Data Ingestion in Big Data and IoT platforms par
Data Ingestion in Big Data and IoT platformsData Ingestion in Big Data and IoT platforms
Data Ingestion in Big Data and IoT platformsGuido Schmutz
2.9K vues59 diapositives
1 content optimization-hug-2010-07-21 par
1 content optimization-hug-2010-07-211 content optimization-hug-2010-07-21
1 content optimization-hug-2010-07-21Hadoop User Group
1.5K vues18 diapositives
Pentaho data integration 4.0 and my sql par
Pentaho data integration 4.0 and my sqlPentaho data integration 4.0 and my sql
Pentaho data integration 4.0 and my sqlAHMED ENNAJI
758 vues39 diapositives
Tracking Active Directory Changes par
Tracking Active Directory ChangesTracking Active Directory Changes
Tracking Active Directory ChangesVyapin Software Systems Private Limited
421 vues15 diapositives

Similaire à Tracking user activity logs using Loggastic #ApiPlatformCon(20)

Alfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti par Alfresco Software
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 ... par Christoph Adler
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 Adler226 vues
Data Ingestion in Big Data and IoT platforms par Guido Schmutz
Data Ingestion in Big Data and IoT platformsData Ingestion in Big Data and IoT platforms
Data Ingestion in Big Data and IoT platforms
Guido Schmutz2.9K vues
Pentaho data integration 4.0 and my sql par AHMED ENNAJI
Pentaho data integration 4.0 and my sqlPentaho data integration 4.0 and my sql
Pentaho data integration 4.0 and my sql
AHMED ENNAJI758 vues
Salesforce Spring 14 Release Developer Overview par Roy Gilad
Salesforce Spring 14 Release Developer OverviewSalesforce Spring 14 Release Developer Overview
Salesforce Spring 14 Release Developer Overview
Roy Gilad3.9K vues
Solve Todays Problems with 10 New SharePoint 2010 Features par Cory Peters
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
Cory Peters2.5K vues
Moving Data in and out of Reltio - It-s Super EASY.pdf par Alex446314
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
Alex44631459 vues
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ... par Christoph Adler
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 Adler243 vues
Importance of ‘Centralized Event collection’ and BigData platform for Analysis ! par Piyush Kumar
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 Kumar8.7K vues
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore par gemziebeth
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
gemziebeth828 vues
TSPUG: Content Management in SharePoint 2010 par Eli Robillard
TSPUG: Content Management in SharePoint 2010TSPUG: Content Management in SharePoint 2010
TSPUG: Content Management in SharePoint 2010
Eli Robillard552 vues
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a... par Amazon Web Services
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a...
Sharepoint 2010 document managment and workflow par Mahmoud Aljarood
Sharepoint 2010 document managment and workflowSharepoint 2010 document managment and workflow
Sharepoint 2010 document managment and workflow
Mahmoud Aljarood2.1K vues

Dernier

Navigating container technology for enhanced security by Niklas Saari par
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas SaariMetosin Oy
14 vues34 diapositives
Quality Engineer: A Day in the Life par
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeJohn Valentino
7 vues18 diapositives
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx par
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptxanimuscrm
15 vues19 diapositives
Introduction to Gradle par
Introduction to GradleIntroduction to Gradle
Introduction to GradleJohn Valentino
5 vues7 diapositives
Understanding HTML terminology par
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminologyartembondar5
6 vues8 diapositives
Ports-and-Adapters Architecture for Embedded HMI par
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIBurkhard Stubert
26 vues19 diapositives

Dernier(20)

Navigating container technology for enhanced security by Niklas Saari par Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 vues
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx par animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 vues
Ports-and-Adapters Architecture for Embedded HMI par Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Myths and Facts About Hospice Care: Busting Common Misconceptions par Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
Fleet Management Software in India par Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable12 vues
Software evolution understanding: Automatic extraction of software identifier... par Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
AI and Ml presentation .pptx par FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8713 vues
JioEngage_Presentation.pptx par admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254556 vues
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation par HCLSoftware
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook AutomationDRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation
DRYiCE™ iAutomate: AI-enhanced Intelligent Runbook Automation
HCLSoftware6 vues
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... par Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller41 vues
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... par Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller42 vues
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action par Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok15 vues
360 graden fabriek par info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492143 vues

Tracking user activity logs using Loggastic #ApiPlatformCon