vrod

vrod

Attaching to existing iex session

I am wondering if I am doing this properly – I made another post about this but I deleted it because maybe it was unclear, so this time I will attempt to make the problem clear.

I am running my app inside iex and there are many log messages. I wish to do some inspections and monitoring of processes and GenStage to see how the progress is going. So I thought I could connect to the running iex session from a different terminal window.

In terminal 1, I start like this: iex --sname conn1 -S mix
In terminal 2, I start like this: iex --sname conn2 --remsh conn1@my-computer -S mix

The problem is that I still see all the log messages in terminal 2, so I still cannot do the inspections.

I am very confused with this and I think I must be doing something wrong. In one simple app, this works ok and the log messages do not appear in terminal 2. But in my regular app, both terminal 1 and terminal 2 show the same firehose of log messages. I have tried removing many things from my app but this still happens.

Thank you for any ideas for how to fix this!

Marked As Solved

jeremyjh

jeremyjh

I don’t see that behaviour in my app; the remsh does not output the log statements. What does your config :logger statement look like in this app?

Also I don’t know what the meaning of -S mix would be in Terminal 2; I doubt it hurts anything but it is unnecessary since you are connecting to a process that has already executed mix.

Also Liked

vrod

vrod

Ah! I was very foolish! The -S mix was the problem! Somehow in my app that causes log messages to appear in the other terminal.

The correct way to do this:

In terminal 1: iex --sname conn1 -S mix
In terminal 2: iex --sname conn2 --remsh conn1@my-computer

Thank you!

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
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
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
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
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
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
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
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
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New

We're in Beta

About us Mission Statement