scottmessinger

scottmessinger

How to silence Oban during an iex session?

@sorentwo I’m running into an issue where I start an iex session (iex -S mix) and then my terminal keeps showing log messages from Oban:

iex(9)> [info] {"event":"notifier:switch","message":"notifier can't receive messages from any nodes, functionality degraded","source":"oban","status":"isolated"}
[info] {"event":"notifier:switch","message":"notifier only receiving messages from its own node, functionality may be degraded","source":"oban","status":"solitary"}
[info] {"event":"notifier:switch","message":"notifier can't receive messages from any nodes, functionality degraded","source":"oban","status":"isolated"}
[info] {"event":"notifier:switch","message":"notifier only receiving messages from its own node, functionality may be degraded","source":"oban","status":"solitary"}
[info] {"event":"notifier:switch","message":"notifier can't receive messages from any nodes, functionality degraded","source":"oban","status":"isolated"}
[info] {"event":"notifier:switch","message":"notifier only receiving messages from its own node, functionality may be degraded","source":"oban","status":"solitary"}

When I run Application.get_env(:app, Oban), I get:

[
  repo: App.PostgresRepo,
  engine: Oban.Engines.Basic,
  queues: [],
  plugins: [],
  log: false
]

(I use the Pro Engine but opted for Basic as it seemed like these messages might be related).

Any idea how to quiet the logs so I can use iex without being constantly interrupted by Oban?
Scott

Most Liked

beepbeepbopbop

beepbeepbopbop

I suspected these logs are from telemetry events it looks like the case here: oban/lib/oban/telemetry.ex at febfc63d8e7afab62ab9a0da9c782d6374f4a752 · oban-bg/oban · GitHub

You could probably put something in your .iex.exs that disables the logger entirely:

# .iex.exs
:ok = Oban.Telemetry.detach_default_logger()

That ought to work, but you could experiment with different log levels and configure your logger to ignore logs lower than info, while setting Oban’s logger to debug. Alternatively, find where you’re calling attach_default_logger and simply code around it if you’re in a certain MIX_ENV.

sorentwo

sorentwo

Oban Core Team

Those particular messages are fixed in Oban v2.17.5. You should only see one message, not have it repeat every 15 seconds.

The top level log option is for Ecto logging (the name isn’t very clear). The logs you’re seeing are from Oban.Telemetry.attach_default_logger. The proper way to silence that in iex is with Oban.Telemetry.detach_default_logger(), as noted by @beepbeepbopbop

mayel

mayel

Here’s another approach I use to access iex and avoid noise from logs / recompilation messages / etc, with a couple simple cli aliases so that logs appear in the first one but not the extra one:

deviex --sname localenv -S mix phx.server

dev-extraiex --sname extra --remsh localenv

Last Post!

Snake-Sanders

Snake-Sanders

It turns out there are two Oban processes in the umbrella project, thank you for spotting that out. I will read again the documentation.
Cheers

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement