module LoggableActivity
This module provides generators for installing and configuring LoggableActivity
. It includes generators for creating initializer, migration, and locale files.
Example usage:
rails generate loggable_activity:install
This will:
-
Create an initializer file in config/initializers/loggable_activity.rb
-
Create a migration file in db/migrate/
-
Create a locale file in config/locales/loggable_activity.en.yml
After running the generator, remember to:
-
Add ‘mount
LoggableActivity::Engine
=> ’/loggable_activity’‘ to your routes.rb file. -
Run ‘rails db:migrate` to create the necessary database tables.
-
Include ‘LoggableActivity::Hook` in the models you want to track.
-
Update the config/loggable_activity.yaml file with the fields you want to track.
-
Ensure the locale files are properly set up in config/locales/loggable_activity.en.yml.
The LoggableActivity
module provides a comprehensive solution for tracking and logging user activities within a Rails application. It offers a flexible and extensible framework for capturing, encrypting, and storing activity data, ensuring that sensitive information is handled securely.
Features:
-
Activity
Logging: Captures user actions across the application, providing insights into user behavior. -
Encryption: Ensures that logged data is encrypted, safeguarding user privacy and data security.
-
Configuration: Offers customizable options to tailor the logging mechanism to specific application needs.
-
Extensibility: Designed to be extensible, allowing developers to add custom logging capabilities as needed.
Components:
-
Hooks: Mechanisms to hook into application events for logging.
-
Activity: The core model representing logged activities.
-
Configuration: Manages configuration settings for the logging mechanism.
-
Encryption: Handles the encryption and decryption of logged data.
-
DataOwner: Identifies the owner of the logged data.
-
Payload: Structures the data to be logged.
-
Error: Defines custom error types for the logging process.
-
Sanitizer: Provides data sanitization utilities.
-
Services: Contains services for building and managing payloads.
-
Concerns: Includes concerns for integrating with application models and controllers.
Usage: To use LoggableActivity
, include it in your Rails application and configure it according to your needs.
This module is designed to be both powerful and easy to integrate, providing a solid foundation for activity logging.
Version of the gem
Constants
- VERSION
Version