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

Drop Logger backends #4862

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Drop Logger backends #4862

merged 2 commits into from
Nov 28, 2024

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Nov 28, 2024

Changes

This PR switches from Logger backends to :logger handlers.

Card: https://3.basecamp.com/5308029/buckets/29267832/card_tables/cards/7610404292

Some time later, once or if there is a need for structured logging, we can also replace ExJsonFormatter with something else.

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@ruslandoga ruslandoga requested a review from a team November 28, 2024 07:31
Copy link

Preview environment👷🏼‍♀️🏗️
PR-4862

@ruslandoga ruslandoga changed the title Drop console logger backend Drop console Logger backend Nov 28, 2024
Logger.add_backend(Sentry.LoggerBackend)
:logger.add_handler(:sentry_handler, Sentry.LoggerHandler, %{
config: %{capture_log_messages: true, level: :error}
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

iex> spawn(fn -> raise "oops" end)
#PID<0.1002.0>
{"time":"2024-11-28 15:20:16.883","msg":"Process #PID<0.1002.0> raised an exception\n** (RuntimeError) oops","level":"error"}
Screenshot 2024-11-28 at 15 21 56

Copy link
Contributor Author

@ruslandoga ruslandoga Nov 28, 2024

Choose a reason for hiding this comment

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

iex> require Logger
iex> Logger.error("oops")
{"time":"2024-11-28 15:25:24.006","msg":"oops","level":"error"}
Screenshot 2024-11-28 at 15 26 20

@ruslandoga ruslandoga changed the title Drop console Logger backend Drop Logger backends Nov 28, 2024
@ruslandoga ruslandoga added this pull request to the merge queue Nov 28, 2024
@ruslandoga ruslandoga removed this pull request from the merge queue due to a manual request Nov 28, 2024
@ruslandoga
Copy link
Contributor Author

ruslandoga commented Nov 28, 2024

@cnkk 👋

Would you be able to merge it when you have time? I think it would be safer this way since I don't have access to Plausible's logs / Sentry / etc. and won't be able to see if anything goes wrong.

@cnkk cnkk added this pull request to the merge queue Nov 28, 2024
Merged via the queue into master with commit 24888cf Nov 28, 2024
10 checks passed
@cnkk cnkk deleted the drop-logger-backends branch November 28, 2024 12:32
This was referenced Dec 17, 2024
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.

3 participants