So, my place of employment has some budgetary concerns and due to that, we don’t record historical info level logs, only warning and error ones. I’m developing a feature that would hugely benefit from some logs for debugging but those logs would be more like breadcrumbs and not warnings or errors. After talking to the person responsible for devops he told me they would start recording notice level logs, since that would work for my feature and still exclude a lot of info logs that might not be necessary.
I was pretty happy with this and switched all the relevant logs to notice level, but somehow they weren’t getting picked up by gcc (which is what we use to see logs). After some investigation we found out that it was because the logs were getting translated to info level.
At the moment the Logger docs have this to say about notice level logs:
level
is one of:debug
,:info
,:warn
, or:error
, as previously described (for compatibility with pre 1.10 backends the:notice
will be translated to:info
and all messages above:error
will be translated to:error
)
I then found this old topic and I confess that most of the discussion went over my head, but I saw it mentioned that the implementation of :logger
was actually s bit newer than elixir’s Logger and from that I got the impression that if perhaps I used :logger
directly I could get actual notice logs. Turns out that that is not true, they still get translated to info.
So my question is, is there any way to actually get notice level logs in an Elixir app?