Why does Logger output in IEX have to have an empty line after every line logged?

This is a capture of iex running my test app. The Logger.debug output statements all have an empty line after them. Is there a way to fix this? It reduces the amount of log lines I can see on a screen by half.


If we’re talking about a Phoenix app, you’ll probably find a line like this in your config: config :logger, :console, format: "[$level] $message\n"

If this is a blank Elixir app, you can add such a line to your config. You can tune the format as you wish.

1 Like


It isn’t a Phoenix app.
But I found the default Logger format is actually:
config :logger, :console, format: "\n$time $metadata[$level] $levelpad$message\n"


So I can just copy it and remove the \n in front.


I can’t for the life of me get this to work, to actually fix the logging output. I can’t be the only one. I’m on Elixir 1.10.2.


config :logger, :console, format: "\n$time $metadata[$level] $levelpad$message\n"


config :logger, :console, format: "$time $metadata[$level] $levelpad$message\n"

in your config.exs file.

Yep, did that. It isn’t changing the format. I know my config setup is fine, as other items are getting set.

1player Thanks a lot.