// Initialize the gAuditLog object $auditLog = new gAuditLog(); // Log a successful login $auditLog->logSuccess('User login', 'User1 successfully logged in'); // Log a failed login attempt $auditLog->logFailure('User login', 'User2 failed to log in');
// Initialize the gAuditLog object with a custom configuration file $configFile = '/path/to/custom/config/file.yaml'; $auditLog = new gAuditLog($configFile); // Log a file deletion event $auditLog->logAction('File deletion', 'File test.txt deleted by User3', ['file' => 'test.txt', 'user' => 'User3']);This example initializes the gAuditLog object with a custom configuration file defined by $configFile. An event is then logged to record the deletion of a file named test.txt by User3. Additional parameters are passed as an associative array to provide more information about the event. Overall, the gAuditLog package library for PHP provides a powerful tool for monitoring and logging events on a website or application. By implementing the package, developers can ensure that their projects remain secure and maintain a detailed audit trail for accountability purposes.