I have an Elixir Phoenix back end app that is serving to an electron app. On my local system, everything is working… deployed in pseudo production, I’m having a few issues. When run locally, I have running terminal output that lets me see incoming requests, and key errors.
When I SSH in, the app is running as a service in the background… which obviously does not show terminal output.
Is there a way to get the same information in Fly? The live logs seem to be the machine state, rather than software application state.
I believe you can just change that last one to level: :debug and then re-deploy.
(Typically, production logging is less verbose than development, otherwise most people would find the useful parts drowned out by prosaic “Got another request and sent another 200 OK” repetitions…)
I think I got the logs to show, but multi-line output is quite… annoying…
If I print an object, then the each line of the object gets a new timestamp and row, and it’s not formatted like it would be on a terminal. Is there anyway to adjust this setting?
I may be misunderstanding what you’re trying, but the logging system is principally for gruff, rather isolated, one-liner notifications. (“New SSH login from user mayailurus@example.com.”) It isn’t really intended to visually reproduce 2D output—not when it comes to minutiae like column alignment and VT-100 effects.
Maybe it would be easier† to change your CMD (or similar) to…
bash -c 'set -o pipefail && /app/bin/server | tee /tmp/raw-stdout.log'
(Might need tweaking for local conditions, .)
Then tail -F /tmp/raw-stdout.log from an SSH session.
†This is a middle ground in that it will generally miss the fancy escape codes for colors and the like—but should preserve other formatting.