Comments (4)
@TwinMist @StephanKrauss I think I'll have time to check this out next week, please wait a little while.
from monolog-mysql.
Reverting commit 45a4bf3 fixes this for me.
For once, the check for unused keys is using a wrong array index:
This should probably be
if(! isset($contentArray[$context]))
.
But the check does not seem to work correctly anyway as the insert statement is build and prepared prior to the unused keys getting removed. Thus, the statement always contains all additional fields/keys.
By (trying to) remove them after the statement has already been prepared, the parameters won't match up.
from monolog-mysql.
Hello,
i have the same problem.
Here is my test setup
```
$pdo = new \PDO('mysql:host=localhost;dbname=monolog', 'monolog', 'monolog');
$mysqlHandler = new \MySQLHandler\MySQLHandler($pdo, "log", array('channel', 'CORRELATION', 'errorFile', 'errorFile', 'errorLine', 'errorTrace'), \Monolog\Logger::INFO);
$logger->pushHandler($mysqlHandler);
$content = [
'test1' => 'aaa',
'test2' => 'bbb'
];
$logger->error('Test', $content);
---------------------------
When i debug the script i find the query for mysql.
Query: INSERT INTO `log` (channel, level, message, time, channel, CORRELATION, errorFile, errorFile, errorLine, errorTrace) VALUES (:channel, :level, :message, :time, :channel, :CORRELATION, :errorFile, :errorFile, :errorLine, :errorTrace)
What is wrong ?
Your sincerly
Stephan
from monolog-mysql.
I've addressed this issue in 4eb4ad3. It will be resolved in the upcomming release v2.
from monolog-mysql.
Related Issues (20)
- Logging fails if the caller does not supply all additional fields HOT 6
- Data should not be deleted when additional field is not provided anymore HOT 1
- "PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number" when used with Silex and Monolog Service Provider HOT 2
- SQLSTATE[HY093]: Invalid parameter number: parameter was not defined HOT 3
- Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens HOT 2
- Implicit committing may interrupt transactions HOT 3
- additional fields types
- How to configure custom types for custom fields HOT 1
- Declaration of MySQLHandler\MySQLHandler::write(array $record) must be compatible with Monolog\Handler\AbstractProcessingHandler::write(array $record): void HOT 5
- Working example
- Include Level name HOT 1
- Dropping or getting around the PDO type hint in MySQLHandler::__construct()? HOT 1
- errors in handler HOT 1
- information to logs table HOT 2
- question regarding capabilities HOT 3
- Multiinsert query issue HOT 2
- PHP 5 Support HOT 3
- Write 'extra' passed by Processors to db HOT 2
- Create indexes HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monolog-mysql.