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

Monolog and PHP 8 updates #40

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

phil-nelson
Copy link

This update fixes an issue working with monolog 2.5 and above, where the IntrospectionProcessor added a callType field to its output. Since the ElasticCommonSchemaFormatter does not know about this field, it gets added as a top level key instead of within log.origin even when $useLogOriginFromContext is set. This can be demonstrated by simply checking out the main branch of this repo and running composer install && composer test.

This fixes the issue by adding callType to the list of known origin keys and also uses it (if available, so will still work with monolog < 2.5) within the log.origin.function field. E.g. MyClass::myFunction or MyClass->myFunction.

As a minor additional change it also marks compatibility with psr/log 2.x and 3.x.

"brianium/paratest": "^3.1",
"monolog/monolog": "^2.0"
"squizlabs/php_codesniffer": "^3.7",
"brianium/paratest": "^6.6",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These updates are required to be able to run tests with PHP 8.

"monolog/monolog": "^2.0"
"squizlabs/php_codesniffer": "^3.7",
"brianium/paratest": "^6.6",
"monolog/monolog": "^2.5"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although still compatible with monolog < 2.5, ^2.5 is required for tests

@apmmachine
Copy link
Contributor

apmmachine commented Jul 29, 2022

❕ 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-08T19:43:15.097+0000

  • Duration: 3 min 51 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/phil-nelson return the message : java.lang.Exception: httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/phil-nelson : httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/phil-nelson : 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"}

🤖 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!)

@paveljanda
Copy link

paveljanda commented Nov 11, 2022

Maybe you can include diff from main...paveljanda:ecs-logging-php:main? (native PHP types)

@v1v
Copy link
Member

v1v commented Feb 8, 2024

run docs-build

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

Successfully merging this pull request may close these issues.

4 participants