[ 
https://issues.apache.org/jira/browse/LOG4PHP-218?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Marie Picot updated LOG4PHP-218:
-------------------------------------

    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:
{code}
'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'
        ),
),
{code}

  was:
When using the appender '_LoggerAppenderPDO_' I declare a parameter 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 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},%env{MDM_DOMAIN_NAME},%c,%level,%message'
                                ),
                        ),


> Undefined variable: end : helpers/LoggerPatternParser.php [119]
> ---------------------------------------------------------------
>
>                 Key: LOG4PHP-218
>                 URL: https://issues.apache.org/jira/browse/LOG4PHP-218
>             Project: Log4php
>          Issue Type: Bug
>          Components: Code
>    Affects Versions: 2.3.0
>            Reporter: Jean-Marie Picot
>            Priority: Minor
>              Labels: patch
>
> 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:
> {code}
> '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'
>       ),
> ),
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to