fluent / fluent-logger-php

A structured logger for Fluentd (PHP)
Other
215 stars 57 forks source link

Seems like the post() method of FluentLogger can not handle numeric arrays #60

Open Blackbam opened 5 years ago

Blackbam commented 5 years ago

This problem was costing me some time to find that only string indicies in the array are allowed:

/**
     * send a message to specified fluentd.
     *
     * @param string $tag
     * @param array  $data
     * @return bool
     *
     * @api
     */
    public function post($tag, array $data)
    {
        $entity = new Entity($tag, $data);

        return $this->postImpl($entity);
    }

I do now know the exact reason for this behaviour, but can you please just apply PHPs strval() function for posted arrays with numeric indicies?

If this problem does not result from the library (I am not 100% sure) please sorry for bothering the wrong implementors ;-)