Adding extra/context to every log entry

I would like to add to Monolog extra current transaction and trace id
How would I do that?

Which particular field should I use to make Elasticsearch understand that particular log belongs to trace/transaction?
Are there any hardcoded keys used for displaying those things in APM and Discovery?

Hi @Legion112. Welcome to our community!
I've added a code snippet at Add support for Log correlation (AKA Logging integration) · Issue #682 · elastic/apm-agent-php · GitHub
Please take a look and let us know if that is what you are looking for.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.