Lager and Logger playing together nicely

From the “things I found the hard way” dept…

If you are using an app that uses Lager internally for logging (hi riak_core and exometer!), your normal Elixir Logger output to console might stop working.

You want to use lager_logger - in Hex.pm and github: https://github.com/PSPDFKit-labs/lager_logger

It provides a configuration that stops Lagger from breaking Logger (you’ll find it in a comment in the source code!), and it will route logs written with Lagger through Logger, so you Logger’s configuration will apply to all your logging.

Thanks Jose and others on irc for guidance on this. Haven’t seen it documented anywhere so wrote this up :slight_smile:
cheers,

m

4 Likes