omerfdmrl / logger
Php Logger Class
v2.1.11
2021-11-06 16:54 UTC
Requires
- jenssegers/agent: ^2.6
README
Advanced Security Class for Php
Features
- Save User IP Address, Device, Platform, Platform Version, Browser, Browser Version, Log Title, Log Message, Log Date, Log Type
- Create Table Automaticly
- Delete, Turncate Table
- Pdo and Mysqli supported
- Get Error
Install
run the following command directly.
$ composer require omerfdmrl/logger
Settings - PDO
include 'vendor/autoload.php'; use Omerfdmrl\Logger\Logger; $logger = new Logger; // PDO Connection $db = new PDO("mysql:host=localhost;dbname=dbname", "db_user", "db_pass"); $logger->db($db,'pdo',True); // First: PDO connection veriable // Second: Connection type (Default is pdo. If using pdo, you may not write) // Third: Create table. If table exist, set as False. Default is True
Settings - Mysqli
include 'vendor/autoload.php'; use Omerfdmrl\Logger\Logger; $logger = new Logger; // Mysqli Connection $db = mysqli_connect('localhost', 'db_user', 'db_pass', 'dbname'); $logger->db($db,'mysqli',True); // First: Mysqli connection veriable // Second: Connection type (Default is pdo. If using pdo, you may not write) // Third: Create table. If table exist, set as False. Default is True
Usage
// Save Log $logger->save('title','message',$user_id,$type); // First: Log title // Second: Log message // Third: User id for spesific user. Default is 0 // Fourth: Log type. Default is 0 // Drop Table $logger->drop(); // Turncate Table $logger->truncate();
Docs
Documentation page: Security Docs
Licence
Contributing
- Fork it ( https://github.com/omerfdmrl/logger/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- omerfdmrl Ömer Faruk Demirel - creator, maintainer