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

Fix usage of Appsignal::Logger#tagged with several tags #1351

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

unflxw
Copy link
Contributor

@unflxw unflxw commented Dec 17, 2024

When calling .tagged on our logger directly (without wrapping it in ActiveSupport::TaggedLogging) we should support passing tags as separate arguments, like newer versions of Rails do.


This should actually fix #1349, as well as this issue encountered by our GoodJob test setup.

When calling `.tagged` on our logger directly (without wrapping it
in `ActiveSupport::TaggedLogging`) we should support passing tags
as separate arguments, like newer versions of Rails do.
@unflxw unflxw force-pushed the fix-tagged-several-tags branch from ae7527e to c8b35ee Compare December 17, 2024 14:34
@unflxw unflxw merged commit 0d83055 into main Dec 18, 2024
151 checks passed
unflxw added a commit that referenced this pull request Dec 19, 2024
This commit removes tagged logging support from `Appsignal::Logger`,
essentially reverting most of the changes in #1344, #1350, #1351 and

The change to use instance variables instead of thread variables is
maintained, as well as the tests that assert the expected behaviour
when used alongside `ActiveSupport::TaggedLogging`, which pass
notwithstanding the reverted functionality. This makes explicit in
our test suite the way in which tagged logging is supported.
unflxw added a commit that referenced this pull request Dec 30, 2024
When a formatter is set for the broadcast logger, also set that same
formatter for all the loggers that it broadcasts to.

Before this change, the already-formatted message would be passed on
to the broadcasted loggers, which would format it once again.

This issue was masked by the tests matching the resulting log line
using `a_string_starting_with`, which I introduced in #1351 to smooth
out differences between our custom instrumentation of tagged logging,
since removed, and that of `ActiveSupport::TaggedLogging`. Ensure all
matching is done against specific strings.

Fixes issue #1360, in which the twice-applied formatting causes
additional newlines to appear in the message emitted by the
broadcasted loggers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v4.2.2 upgrade breaks AppSignal Logger
1 participant