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

Replace gen_event with logger_filter #138

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alanj853
Copy link

@alanj853 alanj853 commented Sep 9, 2024

Elixir 1.15 brought in a lot of changes to logging, particularly around its use of :error_logger. Reports were no longer being received in Shoehorn.ReportHandler. To get around this, we set up a logger_filter that checks for application starts and stop, handles them if necessary, and then lets the other logger filters work as they normally would.

We also make Shoehorn.ReportHandler a GenServer for 2 reasons:
1. To handle the state
2. If the user was to run an Application call in their callback, they will get a crash about a process calling itself. So the call must be done from a separate process because we will get errors about trying to start an application

Lastly, bump up the min Elixir version

Elixir 1.15 brought in a lot of changes to logging, particularly around its use of :error_logger. Reports were no longer being received in Shoehorn.ReportHandler. To get around this, we set up a logger_filter that checks for application starts and stop, handles them if necessary, and then lets the other logger filters work as they normally would.

We also make Shoehorn.ReportHandler a GenServer for 2 reasons:
    1. To handle the state
    2. If the user was to run an Application call in their callback, they will get a crash about a process calling itself. So the call must be done from a separate process because we will get errors about trying to start an application

Lastly, bump up the min Elixir version
@fhunleth
Copy link
Member

@alanj853 Thanks! This is on my todo list. I'll be back soon.

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.

2 participants