elastic / ecs-logging-php

Apache License 2.0
19 stars 35 forks source link

Set "ecs.version" via ElasticCommonSchemaFormatter::__construct() #34

Open lichtner opened 3 years ago

lichtner commented 3 years ago

Now is ECS_VERSION is const, but I need to set version 1.5.0, easiest way is via constructor like this. My version is backward compatible.

Usage in Laravel:

class EcsFormatter
{
    public function __invoke($logger)
    {
        foreach ($logger->getHandlers() as $handler) {
            $handler->setFormatter(new ElasticCommonSchemaFormatter([], '1.5.0'));
        }
    }
}
cla-checker-service[bot] commented 3 years ago

❌ Author of the following commits did not sign a Contributor Agreement: 5518809798542ffe585aafea8ac07878acdf27e2

Please, read and sign the above mentioned agreement if you want to contribute to this project

apmmachine commented 3 years ago

:grey_exclamation: Build Aborted

The PR is not allowed to run in the CI yet

the below badges are clickable and redirect to their specific view in the CI or DOCS Pipeline View Test View Changes Artifacts preview

Expand to view the summary

#### Build stats * Start Time: 2023-02-14T19:43:18.209+0000 * Duration: 0 min 29 sec

Steps errors 2

Expand to view the steps failures

##### `Load a resource file from a library`

  • Took 0 min 0 sec . View more details here
  • Description: approval-list/elastic/ecs-logging-php.yml
##### `Error signal`
  • Took 0 min 0 sec . View more details here
  • Description: githubApiCall: The REST API call https://api.github.com/orgs/elastic/members/lichtner return the message : java.lang.Exception: httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/lichtner : httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/lichtner : Code: 404Error: {"message":"User does not exist or is not a member of the organization","documentation_url":"https://docs.github.com/rest/reference/orgs#check-organization-membership-for-a-user"}

:robot: GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with: - `/test` : Re-trigger the build. - `run` `elasticsearch-ci/docs` : Re-trigger the docs validation. (use unformatted text in the comment!)