Skip to content

fix: register OtelLogHandler in prepend() to fix bundle loading order#18

Merged
jstojiljkovic merged 3 commits into
tracewayapp:masterfrom
srekcud:fix/log-export-service-registration
Apr 16, 2026
Merged

fix: register OtelLogHandler in prepend() to fix bundle loading order#18
jstojiljkovic merged 3 commits into
tracewayapp:masterfrom
srekcud:fix/log-export-service-registration

Conversation

@srekcud

@srekcud srekcud commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Move OtelLogHandler and OtelLoggerFlushSubscriber service definitions from load() to prepend(), right after the monolog handler config is prepended.

This ensures the services exist before MonologBundle::load() compiles its handler references, regardless of bundle registration order in bundles.php.

Fixes #17

Move OtelLogHandler and OtelLoggerFlushSubscriber service definitions
from load() to prepend(), right after the monolog handler config is
prepended.

This ensures the services exist before MonologBundle::load() compiles
its handler references, regardless of bundle registration order in
bundles.php.
@codecov-commenter

codecov-commenter commented Apr 16, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jstojiljkovic

jstojiljkovic commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Hi @srekcud,
Thanks again for the PR.
Before merging, can we add a test that compiles the container with log_export_enabled: true and MonologBundle registered first?

@srekcud

srekcud commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

Yep i will check that in the evening :)

Verify that the container compiles successfully when MonologBundle is
registered before OpenTelemetryBundle with log_export_enabled: true.

Add symfony/monolog-bundle to require-dev to support this test.
@srekcud

srekcud commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

Test added @jstojiljkovic

@jstojiljkovic
jstojiljkovic merged commit 3fad179 into tracewayapp:master Apr 16, 2026
5 checks passed
@srekcud
srekcud deleted the fix/log-export-service-registration branch April 24, 2026 09:20
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.

log_export_enabled: true fails with "non-existent service OtelLogHandler"

3 participants