Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: Trying to access array offset on value of type null #67

Open
marcodefelice opened this issue Aug 12, 2022 · 5 comments
Open

WARNING: Trying to access array offset on value of type null #67

marcodefelice opened this issue Aug 12, 2022 · 5 comments

Comments

@marcodefelice
Copy link

marcodefelice commented Aug 12, 2022

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

@mstenta
Copy link

mstenta commented Oct 26, 2022

I experienced this too, and found that it was already fixed by this commit in 2020: 625410f

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

@NScodeCS
Copy link

Any updates on releasing a new version?

@DQNEO
Copy link
Member

DQNEO commented Jul 19, 2023

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 ?

@NScodeCS
Copy link

@DQNEO I will kindly decline.

@m-ostadi
Copy link

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,
        ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants