GithubHelp home page GithubHelp logo

Comments (4)

cr-lgl avatar cr-lgl commented on August 25, 2024 1

@TwinMist @StephanKrauss I think I'll have time to check this out next week, please wait a little while.

from monolog-mysql.

nox-4O4 avatar nox-4O4 commented on August 25, 2024 1

Reverting commit 45a4bf3 fixes this for me.

For once, the check for unused keys is using a wrong array index:

if(! isset($contentArray[$key])) {

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.

StephanKrauss avatar StephanKrauss commented on August 25, 2024

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.

amacado avatar amacado commented on August 25, 2024

I've addressed this issue in 4eb4ad3. It will be resolved in the upcomming release v2.

from monolog-mysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.