WARNING: Trying to access array offset on value of type null
When submit a new request to a offline fluent server, got an exception but that exception never show an error message becouse on file vendor/fluent/logger/src/FluentLogger.php:328 the function $errors = error_get_last(); doesn't work and the array is NULL
i think is better to fix and show the right error message
just now i've fixed with if(empty($errors)) { $errors['message'] = "Unable to connect to the server"; }
if ok i will commit the fix
I experienced this too, and found that it was already fixed by this commit in 2020: https://github.com/fluent/fluent-logger-php/commit/625410fc62b408d1b5d2b06b6c115f5faf6db2b8
However, there hasn't been a tagged release of this project since v1.0.1 in 2017.
If a new release gets tagged, this will be fixed.
Pinging the maintainers listed in composer.json: @chobie @sotarok @DQNEO
Any updates on releasing a new version?
Sorry for the long absence. Sadly, current maintainers are no longer active in this repo. Would any of you like to be new maintainer of this repo ?
@DQNEO I will kindly decline.
I trace this error with xdebug and I found that it try tcp by default and it not support udp, and the fluentd syslog input is set on udp by default. So for using udp I go for monolog SyslogUdpHandler and tried this config and it worked for me. add this config to logging channels :
'fluent' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => \Monolog\Handler\SyslogUdpHandler::class,
'handler_with' => [
'host' => env("FLUENTD_HOST"),
'port' => env("FLUENTD_PORT"),
'rfc' => \Monolog\Handler\SyslogUdpHandler::RFC3164 ,
'ident' => 'laravel', //tag
//'facility' => LOG_LOCAL0 //default => LOG_USER ( this specify the second word after period in tag)
],
'formatter' => \Monolog\Formatter\JsonFormatter::class,
]