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

Log channel is ignored #25

Closed
Radiergummi opened this issue Mar 29, 2021 · 0 comments
Closed

Log channel is ignored #25

Radiergummi opened this issue Mar 29, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Radiergummi
Copy link
Member

If the environment variable ELASTIC_LOGGER is set, and/or the configuration directive es.logger points to a log channel as configured in config/logging.php, it is ignored and an instance of the default logger is passed to the Elasticsearch client factory instead.
This is caused by the provider properly checking for the logger, but injecting the PSR LoggerInterface instead of the configured logger instance:

$logger = Config::get('es.logger') && $app->bound('es.logger')
    ? $app->make(LoggerInterface::class)
    : null;

Instead, we should inject the logger by its identifier:

$logger = Config::get('es.logger') && $app->bound('es.logger')
    ? $app->make('es.logger')
    : null;
@Radiergummi Radiergummi added the bug Something isn't working label Mar 29, 2021
@Radiergummi Radiergummi self-assigned this Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant