Skip to content

Drop Logger backends - #4862

Merged
cnkk merged 2 commits into
masterfrom
drop-logger-backends
Nov 28, 2024
Merged

Drop Logger backends#4862
cnkk merged 2 commits into
masterfrom
drop-logger-backends

Conversation

@ruslandoga

@ruslandoga ruslandoga commented Nov 28, 2024

Copy link
Copy Markdown
Contributor

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
@github-actions

Copy link
Copy Markdown
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
Copy Markdown
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

@ruslandoga ruslandoga Nov 28, 2024

Copy link
Copy Markdown
Contributor Author

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

ruslandoga commented Nov 28, 2024

Copy link
Copy Markdown
Contributor Author

@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
@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