Uploaded image for project: 'Log4php'
  1. Log4php
  2. LOG4PHP-218

Undefined variable: end : helpers/LoggerPatternParser.php [119]

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.3.0
    • None
    • Code

    Description

      When using the appender 'LoggerAppenderPDO' I declare a parameter dynamically in my prepareStatement in format String and not use the conversion specifiers.
      So, in the parse() method in the class LoggerPatternParser, the variable $end is not defined and generates an notice exception php.

      For example, an extract of my php logger configuration:

      'bdd' => array(
      	'class' => 'LoggerAppenderPDO',
      	'params' => array(
      		'dsn' => 'mysql:host='.DB_HOST.';dbname=mdm_utils',
      		'user' => DB_LOGIN,
      		'password' => DB_PASSWORD,
      		'table' => 'log',
      		'insertSql' => 'INSERT INTO __TABLE__ (dt_log, environnement, logger, level_log, message) VALUES (?, ?, ?, ?, ?)',
      		'insertPattern' => '%date{Y-m-d H:i:s},' . getHostName() . ',%c,%level,%message'
      	),
      ),
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            jmpicot Jean-Marie Picot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: