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 von 64

Recomendados

UCIAD overview von
UCIAD overviewUCIAD overview
UCIAD overviewMathieu d'Aquin
830 views26 Folien
Spring 15 von
Spring 15Spring 15
Spring 15Jyothylakshmy P.U
321 views18 Folien
Best practices for migrating from SharePoint Designer to Power Automate von
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 views60 Folien
Stefaan Ponnet, Fusebox von
Stefaan Ponnet, FuseboxStefaan Ponnet, Fusebox
Stefaan Ponnet, Fuseboxnascomgenk
1.6K views27 Folien
ELK Solutions Enablement Session - 17th March'2020 von
ELK Solutions Enablement Session - 17th March'2020ELK Solutions Enablement Session - 17th March'2020
ELK Solutions Enablement Session - 17th March'2020Ashnikbiz
156 views55 Folien
Getting It System Toolkit: Enhancing User Experience & Customizing a Future f... von
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 views53 Folien

Más contenido relacionado

Similar a Tracking user activity logs using Loggastic #ApiPlatformCon

Alfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti von
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 views10 Folien
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ... von
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 views66 Folien
Data Ingestion in Big Data and IoT platforms von
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 views59 Folien
1 content optimization-hug-2010-07-21 von
1 content optimization-hug-2010-07-211 content optimization-hug-2010-07-21
1 content optimization-hug-2010-07-21Hadoop User Group
1.5K views18 Folien
Pentaho data integration 4.0 and my sql von
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 views39 Folien
Tracking Active Directory Changes von
Tracking Active Directory ChangesTracking Active Directory Changes
Tracking Active Directory ChangesVyapin Software Systems Private Limited
421 views15 Folien

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

Alfresco Day Amsterdam 2015, Technical Track - Doing more with Activiti von 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
Alfresco Software512 views
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ... von 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 views
Data Ingestion in Big Data and IoT platforms von 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 views
Pentaho data integration 4.0 and my sql von 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 views
Audit logging von Son Nguyen
Audit loggingAudit logging
Audit logging
Son Nguyen1.1K views
Salesforce Spring 14 Release Developer Overview von Roy Gilad
Salesforce Spring 14 Release Developer OverviewSalesforce Spring 14 Release Developer Overview
Salesforce Spring 14 Release Developer Overview
Roy Gilad3.9K views
Meetup milano #4 log management and anypoint advanced monitoring von Gonzalo Marcos Ansoain
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 von 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 views
Moving Data in and out of Reltio - It-s Super EASY.pdf von 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
Alex44631458 views
CC Technology Summit 3 Update von Nathan Yergler
CC Technology Summit 3 UpdateCC Technology Summit 3 Update
CC Technology Summit 3 Update
Nathan Yergler1.3K views
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ... von 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 views
Importance of ‘Centralized Event collection’ and BigData platform for Analysis ! von 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 views
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore von 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 views
TSPUG: Content Management in SharePoint 2010 von Eli Robillard
TSPUG: Content Management in SharePoint 2010TSPUG: Content Management in SharePoint 2010
TSPUG: Content Management in SharePoint 2010
Eli Robillard552 views
AWS re:Invent 2016: Workshop: AWS S3 Deep-Dive Hands-On Workshop: Deploying a... von 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...
Amazon Web Services4.1K views
Sharepoint 2010 document managment and workflow von Mahmoud Aljarood
Sharepoint 2010 document managment and workflowSharepoint 2010 document managment and workflow
Sharepoint 2010 document managment and workflow
Mahmoud Aljarood2.1K views

Último

Headless JS UG Presentation.pptx von
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptxJack Spektor
8 views24 Folien
Myths and Facts About Hospice Care: Busting Common Misconceptions von
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 MisconceptionsCare Coordinations
6 views1 Folie
SAP FOR CONTRACT MANUFACTURING.pdf von
SAP FOR CONTRACT MANUFACTURING.pdfSAP FOR CONTRACT MANUFACTURING.pdf
SAP FOR CONTRACT MANUFACTURING.pdfVirendra Rai, PMP
13 views2 Folien
Sprint 226 von
Sprint 226Sprint 226
Sprint 226ManageIQ
5 views18 Folien
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action von
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 ActionMárton Kodok
6 views55 Folien
MS PowerPoint.pptx von
MS PowerPoint.pptxMS PowerPoint.pptx
MS PowerPoint.pptxLitty Sylus
5 views14 Folien

Último(20)

Headless JS UG Presentation.pptx von Jack Spektor
Headless JS UG Presentation.pptxHeadless JS UG Presentation.pptx
Headless JS UG Presentation.pptx
Jack Spektor8 views
Myths and Facts About Hospice Care: Busting Common Misconceptions von 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
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action von 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 Kodok6 views
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h... von Deltares
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...
Deltares9 views
Software evolution understanding: Automatic extraction of software identifier... von 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...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... von Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... von 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üller41 views
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J... von Deltares
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
Deltares12 views
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs von Deltares
DSD-INT 2023 The Danube Hazardous Substances Model - KovacsDSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
Deltares10 views
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... von NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi212 views
tecnologia18.docx von nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 views
FIMA 2023 Neo4j & FS - Entity Resolution.pptx von Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j8 views

Tracking user activity logs using Loggastic #ApiPlatformCon