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

Throw an exception while using %request and sending parameter key as array

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      I used conversation pattern "Request:[%request]" in log4php xml configuration file. When I'm sending request with parameters as an array it throw an exception instead of logging request.

      Request example:
      URL:

      {request URL}

      Method: POST
      Form data:
      data[test1]=test

      Exception trace:
      A PHP Error was encountered

      Severity: Notice

      Message: Array to string conversion

      Filename: pattern/LoggerPatternConverterSuperglobal.php

      Line Number: 93

      Backtrace:

      File: \apache\log4php\src\main\php\pattern\LoggerPatternConverterSuperglobal.php
      Line: 93
      Function: _error_handler

      File: \apache\log4php\src\main\php\pattern\LoggerPatternConverter.php
      Line: 62
      Function: activateOptions

      File: \apache\log4php\src\main\php\helpers\LoggerPatternParser.php
      Line: 179
      Function: __construct

      File: \apache\log4php\src\main\php\helpers\LoggerPatternParser.php
      Line: 149
      Function: getConverter

      File: \apache\log4php\src\main\php\helpers\LoggerPatternParser.php
      Line: 113
      Function: addConverter

      File: \apache\log4php\src\main\php\layouts\LoggerLayoutPattern.php
      Line: 153
      Function: parse

      File: \apache\log4php\src\main\php\configurators\LoggerConfiguratorDefault.php
      Line: 346
      Function: activateOptions

      File: \apache\log4php\src\main\php\configurators\LoggerConfiguratorDefault.php
      Line: 299
      Function: createAppenderLayout

      File: \apache\log4php\src\main\php\configurators\LoggerConfiguratorDefault.php
      Line: 201
      Function: configureAppender

      File: \apache\log4php\src\main\php\configurators\LoggerConfiguratorDefault.php
      Line: 84
      Function: doConfigure

      File: \apache\log4php\src\main\php\Logger.php
      Line: 543
      Function: configure

        Activity

        Hide
        shorif2000 sharif Uddin added a comment -

        any update on this issue as I am having the same problem. it has been about a year now?

        Show
        shorif2000 sharif Uddin added a comment - any update on this issue as I am having the same problem. it has been about a year now?
        Hide
        shorif2000 sharif Uddin added a comment -

        I replaced line 62 of the file with

        <code>
        if(is_array($value))

        { $values[] = "$key=" . implode(",",$value); }

        else

        { $values[] = "$key=$value"; }

        </code>

        Show
        shorif2000 sharif Uddin added a comment - I replaced line 62 of the file with <code> if(is_array($value)) { $values[] = "$key=" . implode(",",$value); } else { $values[] = "$key=$value"; } </code>

          People

          • Assignee:
            Unassigned
            Reporter:
            priyank780 Priyank
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development