[GH-ISSUE #1660] Error Elasticsearch client reference and not supported _type tag #711

Closed
opened 2026-03-04 02:17:16 +03:00 by kerem · 5 comments
Owner

Originally created by @davidfabbretti on GitHub (Apr 26, 2022).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1660

github.com/Seldaek/monolog@4192345e26/src/Monolog/Handler/ElasticsearchHandler.php (L21)

Must be:

use Elastic\Elasticsearch\Client;

AND

github.com/Seldaek/monolog@4192345e26/src/Monolog/Handler/ElasticsearchHandler.php (L138)

Unsupported _type tag

Originally created by @davidfabbretti on GitHub (Apr 26, 2022). Original GitHub issue: https://github.com/Seldaek/monolog/issues/1660 https://github.com/Seldaek/monolog/blob/4192345e260f1d51b365536199744b987e160edc/src/Monolog/Handler/ElasticsearchHandler.php#L21 Must be: use Elastic\Elasticsearch\Client; AND https://github.com/Seldaek/monolog/blob/4192345e260f1d51b365536199744b987e160edc/src/Monolog/Handler/ElasticsearchHandler.php#L138 Unsupported _type tag
kerem 2026-03-04 02:17:16 +03:00
  • closed this issue
  • added the
    Feature
    label
Author
Owner

@davidfabbretti commented on GitHub (Apr 26, 2022):

laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (TypeError(code: 0): Monolog\Handler\ElasticsearchHandler::__construct(): Argument #1 ($client) must be of type Elasticsearch\Client, Elastic\Elasticsearch\Client given, called in /app/Providers/ElasticLogProvider.php on line 44 at /vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php:60)

<!-- gh-comment-id:1110032865 --> @davidfabbretti commented on GitHub (Apr 26, 2022): laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (TypeError(code: 0): Monolog\\Handler\\ElasticsearchHandler::__construct(): Argument #1 ($client) must be of type Elasticsearch\\Client, Elastic\\Elasticsearch\\Client given, called in /app/Providers/ElasticLogProvider.php on line 44 at /vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php:60)
Author
Owner

@davidfabbretti commented on GitHub (Apr 26, 2022):

400 Bad Request: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Action/metadata line [1] contains an unknown parameter [_type]"}],"type":"illegal_argument_exception","reason":"Action/metadata line [1] contains an unknown parameter [_type]"},"status":400}

<!-- gh-comment-id:1110035464 --> @davidfabbretti commented on GitHub (Apr 26, 2022): 400 Bad Request: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Action/metadata line [1] contains an unknown parameter [_type]"}],"type":"illegal_argument_exception","reason":"Action/metadata line [1] contains an unknown parameter [_type]"},"status":400}
Author
Owner

@Seldaek commented on GitHub (May 3, 2022):

The problem is you're using elasticsearch/elasticsearch v8 which changed some things.

See #1662 for ES8 support, but in the meantime I suggest you use v7.

<!-- gh-comment-id:1116448194 --> @Seldaek commented on GitHub (May 3, 2022): The problem is you're using elasticsearch/elasticsearch v8 which changed some things. See #1662 for ES8 support, but in the meantime I suggest you use v7.
Author
Owner

@ezimuel commented on GitHub (May 7, 2022):

@davidfabbretti the _type is not supported anymore in Elasticsearch 8. This parameter has been deprecated in Elasticsearch 7, read here for more details.

<!-- gh-comment-id:1120221266 --> @ezimuel commented on GitHub (May 7, 2022): @davidfabbretti the `_type` is not supported anymore in Elasticsearch 8. This parameter has been deprecated in Elasticsearch 7, read [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/removal-of-types.html) for more details.
Author
Owner

@Seldaek commented on GitHub (May 8, 2022):

OK should be fixed by #1662

<!-- gh-comment-id:1120482268 --> @Seldaek commented on GitHub (May 8, 2022): OK should be fixed by #1662
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#711
No description provided.