waza-ari / monolog-mysql

MySQL Handler for Monolog, which allows to store log messages to a MySQL Table
MIT License
141 stars 85 forks source link

Multiinsert query issue #43

Closed onebeat closed 2 years ago

onebeat commented 3 years ago

Hello, i am have installed and setup this addon for mysql but i have issue that one insert in db is multiinserted for 15 times. i am using MVC php framework of my own i dont have clue what can be issue. I have debug mysql insert query and it only shows 1 insert and what is strange there all have some timeframe.

Can you help me with this issue ?

Thank you very much.

onebeat commented 2 years ago

This is my function that runs monolog mysql, i have just add option for monolog mysql

function audit_info($channel,$msg=null,$data=null) { $db = new Database(); $pdo = $db->externalAccess();

$logger = new Logger($channel);
$handler = new MySQLHandler($pdo,"app_audit",array('user_id'), \Monolog\Logger::INFO);
$logger->pushHandler($handler);
$logger->addInfo($msg,$data);

}

onebeat commented 2 years ago

I have solved the issue, internal system error...